Skip to content

Commit

Permalink
Minor code style improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
Crystal-Spider committed Jul 4, 2024
1 parent 1a33d26 commit d6e8385
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static synchronized Supplier<LeatheredBootsItem> registerBoots(@NotNull S
if (LEATHERED_BOOTS.containsKey(id)) {
Constants.LOGGER.error("LeatheredBootsItem [{}] was already registered.", id);
}
return LEATHERED_BOOTS.computeIfAbsent(id, key -> CobwebRegistry.ofItems(modId).register(key.getPath(), Services.ITEM_HELPER.supplyItem(leatheredArmorMaterial, isFireResistant)));
return LEATHERED_BOOTS.computeIfAbsent(id, key -> CobwebRegistry.ofItems(modId).register(key.getPath(), Services.ITEM.supplyItem(leatheredArmorMaterial, isFireResistant)));
}

/**
Expand Down Expand Up @@ -115,6 +115,7 @@ public static List<LeatheredBootsItem> getBoots() {
/**
* Returns the list of all registered {@link LeatheredBootsItem}s by the specified mod.
*
* @param modId mod ID.
* @return the list of all registered {@link LeatheredBootsItem}s by the specified mod.
*/
public static List<LeatheredBootsItem> getBoots(@NotNull String modId) {
Expand Down Expand Up @@ -157,6 +158,7 @@ public static List<ItemStack> getBootsStack() {
/**
* Returns the list of all {@link ItemStack}s of all registered {@link LeatheredBootsItem}s by the specified mod.
*
* @param modId mod ID.
* @return the list of all {@link ItemStack}s of all registered {@link LeatheredBootsItem}s by the specified mod.
*/
public static List<ItemStack> getBootsStack(@NotNull String modId) {
Expand Down Expand Up @@ -201,6 +203,7 @@ public static List<String> getModIds() {
* Returns the {@link ResourceLocation} that would be given to a {@link LeatheredBootsItem} of the given {@link ArmorMaterial} when registered.<br />
* <strong>Note</strong>: this does not grant that such a {@link LeatheredBootsItem} has been registered.
*
* @param modId mod ID.
* @param armorMaterial armor material.
* @return {@link ResourceLocation} for a {@link LeatheredBootsItem} made of the given {@link ArmorMaterial}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public final class ItemRegistry {
* Leathered boots tab.<br />
* Includes all registered leathered boots.
*/
public static final Supplier<CreativeModeTab> LEATHERED_BOOTS_TAB = CREATIVE_TABS.register(Constants.LEATHERED_BOOTS_TAB_ID, Services.ITEM_HELPER.supplyTab(
public static final Supplier<CreativeModeTab> LEATHERED_BOOTS_TAB = CREATIVE_TABS.register(Constants.LEATHERED_BOOTS_TAB_ID, Services.ITEM.supplyTab(
() -> LeatheredBootsManager.getBootsStack(Constants.MOD_ID, LeatheredArmorMaterial.LEATHERED_NETHERITE),
Constants.LEATHERED_BOOTS_TAB_ID,
output -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
import it.crystalnest.leathered_boots.Constants;
import it.crystalnest.leathered_boots.platform.services.ItemHelper;
import it.crystalnest.leathered_boots.platform.services.PlatformHelper;
import org.jetbrains.annotations.ApiStatus;

import java.util.ServiceLoader;

/**
* Service loaders are a built-in Java feature that allow us to locate implementations of an interface that vary from one environment to another.
* In the context of MultiLoader we use this feature to access a mock API in the common code that is swapped out for the platform specific implementation at runtime.
*/
@ApiStatus.Internal
public final class Services {
/**
* Provides information about what platform the mod is running on.
Expand All @@ -21,7 +19,7 @@ public final class Services {
/**
* Provides abstraction over creative mod tabs.
*/
public static final ItemHelper ITEM_HELPER = load(ItemHelper.class);
public static final ItemHelper ITEM = load(ItemHelper.class);

private Services() {}

Expand Down

This file was deleted.

This file was deleted.

0 comments on commit d6e8385

Please sign in to comment.