From f48665da6d3668ecfa4c3972611a1cef03992737 Mon Sep 17 00:00:00 2001 From: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Date: Sat, 18 Nov 2023 19:18:04 -0600 Subject: [PATCH] Fix the case of SlimefunItem#itemhandlers --- .../slimefun4/api/items/SlimefunItem.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java index d3bc8368fd..20a12ef6b7 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java @@ -109,7 +109,7 @@ public class SlimefunItem implements Placeable { private Optional wikiURL = Optional.empty(); - private final OptionalMap, ItemHandler> itemhandlers = new OptionalMap<>(HashMap::new); + private final OptionalMap, ItemHandler> itemHandlers = new OptionalMap<>(HashMap::new); private final Set> itemSettings = new HashSet<>(); private boolean ticking = false; @@ -477,12 +477,12 @@ public void register(@Nonnull SlimefunAddon addon) { onEnable(); } else { // Clear item handlers if we are disabled so that calling them isn't possible later on - for (ItemHandler handler : this.itemhandlers.values()) { + for (ItemHandler handler : this.itemHandlers.values()) { if (handler instanceof BlockTicker) { Slimefun.getRegistry().getTickerBlocks().remove(getId()); } } - this.itemhandlers.clear(); + this.itemHandlers.clear(); } // Lock the SlimefunItemStack from any accidental manipulations @@ -540,7 +540,7 @@ private final void onEnable() { } private void loadItemHandlers() { - for (ItemHandler handler : itemhandlers.values()) { + for (ItemHandler handler : itemHandlers.values()) { Optional exception = handler.validate(this); // Check if the validation caused an exception. @@ -802,7 +802,7 @@ public final void addItemHandler(ItemHandler... handlers) { } for (ItemHandler handler : handlers) { - itemhandlers.put(handler.getIdentifier(), handler); + itemHandlers.put(handler.getIdentifier(), handler); // Tickers are a special case (at the moment at least) if (handler instanceof BlockTicker ticker) { @@ -914,7 +914,7 @@ public final void addOfficialWikipage(@Nonnull String page) { * @return The Set of item handlers */ public @Nonnull Collection getHandlers() { - return itemhandlers.values(); + return itemHandlers.values(); } /** @@ -932,7 +932,7 @@ public final void addOfficialWikipage(@Nonnull String page) { */ @ParametersAreNonnullByDefault public boolean callItemHandler(Class c, Consumer callable) { - Optional handler = itemhandlers.get(c); + Optional handler = itemHandlers.get(c); if (handler.isPresent()) { try {