diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/infinityexpansion/FastInfinityWorkbench.java b/src/main/java/net/guizhanss/fastmachines/items/machines/infinityexpansion/FastInfinityWorkbench.java index 52dd5a3..9abf203 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/infinityexpansion/FastInfinityWorkbench.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/infinityexpansion/FastInfinityWorkbench.java @@ -1,7 +1,6 @@ package net.guizhanss.fastmachines.items.machines.infinityexpansion; import java.util.List; -import java.util.logging.Level; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; @@ -25,13 +24,8 @@ public FastInfinityWorkbench(SlimefunItemStack item, RecipeType recipeType, Item @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); - try { - List rawRecipes = RecipeUtils.getInfinityMachineRecipes(InfinityWorkbench.class); - RecipeUtils.registerRecipes(recipes, rawRecipes, false); - } catch (Exception ex) { - FastMachines.log(Level.SEVERE, ex, "An error has occurred while registering recipes for {0}", getClass().getSimpleName()); - } + List rawRecipes = RecipeUtils.getInfinityMachineRecipes(InfinityWorkbench.class); + RecipeUtils.registerRecipes(recipes, rawRecipes, false); } @Override diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/infinityexpansion/FastMobDataInfuser.java b/src/main/java/net/guizhanss/fastmachines/items/machines/infinityexpansion/FastMobDataInfuser.java index 2234ef2..5b74f5d 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/infinityexpansion/FastMobDataInfuser.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/infinityexpansion/FastMobDataInfuser.java @@ -1,7 +1,6 @@ package net.guizhanss.fastmachines.items.machines.infinityexpansion; import java.util.List; -import java.util.logging.Level; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; @@ -25,13 +24,8 @@ public FastMobDataInfuser(SlimefunItemStack item, RecipeType recipeType, ItemSta @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); - try { - List rawRecipes = RecipeUtils.getInfinityMachineRecipes(MobDataInfuser.class); - RecipeUtils.registerRecipes(recipes, rawRecipes, false); - } catch (Exception ex) { - FastMachines.log(Level.SEVERE, ex, "An error has occurred while registering recipes for {0}", getClass().getSimpleName()); - } + List rawRecipes = RecipeUtils.getInfinityMachineRecipes(MobDataInfuser.class); + RecipeUtils.registerRecipes(recipes, rawRecipes, false); } @Override diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/slimeframe/FastSlimeFrameFoundry.java b/src/main/java/net/guizhanss/fastmachines/items/machines/slimeframe/FastSlimeFrameFoundry.java index 675d37c..fcf4210 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/slimeframe/FastSlimeFrameFoundry.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/slimeframe/FastSlimeFrameFoundry.java @@ -23,7 +23,6 @@ public FastSlimeFrameFoundry(SlimefunItemStack item, RecipeType recipeType, Item @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); RecipeUtils.registerMultiblockMachineRecipes(recipes, SFrameStacks.FOUNDRY.getItemId(), false); } diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastAncientAltar.java b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastAncientAltar.java index afc9157..7275b4f 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastAncientAltar.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastAncientAltar.java @@ -2,7 +2,6 @@ import java.util.ArrayList; import java.util.List; -import java.util.logging.Level; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; @@ -28,23 +27,18 @@ public FastAncientAltar(SlimefunItemStack item, RecipeType recipeType, ItemStack @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); - try { - var altar = (AncientAltar) SlimefunItems.ANCIENT_ALTAR.getItem(); - List rawRecipes = new ArrayList<>(); - for (var recipe : altar.getRecipes()) { - if (recipe.getOutput().getType() == Material.SPAWNER) { - continue; - } - var input = new ArrayList<>(recipe.getInput()); - input.add(recipe.getCatalyst()); - RawRecipe rawRecipe = new RawRecipe(input.toArray(new ItemStack[9]), new ItemStack[] {recipe.getOutput()}); - rawRecipes.add(rawRecipe); + var altar = (AncientAltar) SlimefunItems.ANCIENT_ALTAR.getItem(); + List rawRecipes = new ArrayList<>(); + for (var recipe : altar.getRecipes()) { + if (recipe.getOutput().getType() == Material.SPAWNER) { + continue; } - RecipeUtils.registerRecipes(recipes, rawRecipes, false); - } catch (Exception ex) { - FastMachines.log(Level.SEVERE, ex, "An error has occurred while registering recipes for {0}", getClass().getSimpleName()); + var input = new ArrayList<>(recipe.getInput()); + input.add(recipe.getCatalyst()); + RawRecipe rawRecipe = new RawRecipe(input.toArray(new ItemStack[9]), new ItemStack[] {recipe.getOutput()}); + rawRecipes.add(rawRecipe); } + RecipeUtils.registerRecipes(recipes, rawRecipes, false); } @Override diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastArmorForge.java b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastArmorForge.java index 99a1f63..0d73c7a 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastArmorForge.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastArmorForge.java @@ -22,7 +22,6 @@ public FastArmorForge(SlimefunItemStack item, RecipeType recipeType, ItemStack[] @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); RecipeUtils.registerMultiblockMachineRecipes(recipes, SlimefunItems.ARMOR_FORGE.getItemId(), false); } diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastComposter.java b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastComposter.java index fb13da6..dc3fbc3 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastComposter.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastComposter.java @@ -22,7 +22,6 @@ public FastComposter(SlimefunItemStack item, RecipeType recipeType, ItemStack[] @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); RecipeUtils.registerDisplayRecipes(recipes, SlimefunItems.COMPOSTER.getItemId(), false); } diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastCompressor.java b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastCompressor.java index 19c7919..dccb60d 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastCompressor.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastCompressor.java @@ -22,7 +22,6 @@ public FastCompressor(SlimefunItemStack item, RecipeType recipeType, ItemStack[] @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); RecipeUtils.registerMultiblockMachineRecipes(recipes, SlimefunItems.COMPRESSOR.getItemId(), false); } diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastEnhancedCraftingTable.java b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastEnhancedCraftingTable.java index d954c01..deac200 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastEnhancedCraftingTable.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastEnhancedCraftingTable.java @@ -22,7 +22,6 @@ public FastEnhancedCraftingTable(SlimefunItemStack item, RecipeType recipeType, @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); RecipeUtils.registerMultiblockMachineRecipes(recipes, SlimefunItems.ENHANCED_CRAFTING_TABLE.getItemId(), false); } diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastGrindStone.java b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastGrindStone.java index 8751e4b..7a4260d 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastGrindStone.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastGrindStone.java @@ -22,7 +22,6 @@ public FastGrindStone(SlimefunItemStack item, RecipeType recipeType, ItemStack[] @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); RecipeUtils.registerMultiblockMachineRecipes(recipes, SlimefunItems.GRIND_STONE.getItemId(), false); } diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastJuicer.java b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastJuicer.java index 993b59e..df8a989 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastJuicer.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastJuicer.java @@ -22,7 +22,6 @@ public FastJuicer(SlimefunItemStack item, RecipeType recipeType, ItemStack[] rec @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); RecipeUtils.registerMultiblockMachineRecipes(recipes, SlimefunItems.JUICER.getItemId(), false); } diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastMagicWorkbench.java b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastMagicWorkbench.java index 09310c3..e6a6f43 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastMagicWorkbench.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastMagicWorkbench.java @@ -22,7 +22,6 @@ public FastMagicWorkbench(SlimefunItemStack item, RecipeType recipeType, ItemSta @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); RecipeUtils.registerMultiblockMachineRecipes(recipes, SlimefunItems.MAGIC_WORKBENCH.getItemId(), false); } diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastOreCrusher.java b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastOreCrusher.java index 3789a17..97c5999 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastOreCrusher.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastOreCrusher.java @@ -22,7 +22,6 @@ public FastOreCrusher(SlimefunItemStack item, RecipeType recipeType, ItemStack[] @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); RecipeUtils.registerMultiblockMachineRecipes(recipes, SlimefunItems.ORE_CRUSHER.getItemId(), true); } diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastOreWasher.java b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastOreWasher.java index 77dcb79..bf3d9ed 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastOreWasher.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastOreWasher.java @@ -22,7 +22,6 @@ public FastOreWasher(SlimefunItemStack item, RecipeType recipeType, ItemStack[] @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); RecipeUtils.registerMultiblockMachineRecipes(recipes, SlimefunItems.ORE_WASHER.getItemId(), true); } diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastPanningMachine.java b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastPanningMachine.java index b4f4835..9f87b37 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastPanningMachine.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastPanningMachine.java @@ -22,7 +22,6 @@ public FastPanningMachine(SlimefunItemStack item, RecipeType recipeType, ItemSta @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); RecipeUtils.registerDisplayRecipes(recipes, SlimefunItems.AUTOMATED_PANNING_MACHINE.getItemId(), true); } diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastPressureChamber.java b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastPressureChamber.java index 8bac919..52853d3 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastPressureChamber.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastPressureChamber.java @@ -22,7 +22,6 @@ public FastPressureChamber(SlimefunItemStack item, RecipeType recipeType, ItemSt @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); RecipeUtils.registerMultiblockMachineRecipes(recipes, SlimefunItems.PRESSURE_CHAMBER.getItemId(), false); } diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastSmeltery.java b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastSmeltery.java index c08de85..7ccd402 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastSmeltery.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastSmeltery.java @@ -22,7 +22,6 @@ public FastSmeltery(SlimefunItemStack item, RecipeType recipeType, ItemStack[] r @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); RecipeUtils.registerMultiblockMachineRecipes(recipes, SlimefunItems.SMELTERY.getItemId(), false); } diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastTableSaw.java b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastTableSaw.java index 041d8fc..434bc72 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastTableSaw.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/slimefun/FastTableSaw.java @@ -22,7 +22,6 @@ public FastTableSaw(SlimefunItemStack item, RecipeType recipeType, ItemStack[] r @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); RecipeUtils.registerDisplayRecipes(recipes, SlimefunItems.TABLE_SAW.getItemId(), false); } diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/vanilla/FastCraftingTable.java b/src/main/java/net/guizhanss/fastmachines/items/machines/vanilla/FastCraftingTable.java index a9a7720..54eec8a 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/vanilla/FastCraftingTable.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/vanilla/FastCraftingTable.java @@ -23,7 +23,6 @@ public FastCraftingTable(SlimefunItemStack item, RecipeType recipeType, ItemStac @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); RecipeUtils.registerVanillaRecipes(recipes, ShapedRecipe.class); RecipeUtils.registerVanillaRecipes(recipes, ShapelessRecipe.class); } diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/vanilla/FastFurnace.java b/src/main/java/net/guizhanss/fastmachines/items/machines/vanilla/FastFurnace.java index 05f263e..a301c7b 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/machines/vanilla/FastFurnace.java +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/vanilla/FastFurnace.java @@ -22,7 +22,6 @@ public FastFurnace(SlimefunItemStack item, RecipeType recipeType, ItemStack[] re @Override public void registerRecipes() { - FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); RecipeUtils.registerVanillaRecipes(recipes, FurnaceRecipe.class); } diff --git a/src/main/java/net/guizhanss/fastmachines/listeners/SlimefunRegistryLoadedListener.java b/src/main/java/net/guizhanss/fastmachines/listeners/SlimefunRegistryLoadedListener.java index 924dce0..0db47c5 100644 --- a/src/main/java/net/guizhanss/fastmachines/listeners/SlimefunRegistryLoadedListener.java +++ b/src/main/java/net/guizhanss/fastmachines/listeners/SlimefunRegistryLoadedListener.java @@ -1,5 +1,7 @@ package net.guizhanss.fastmachines.listeners; +import java.util.logging.Level; + import javax.annotation.Nonnull; import javax.annotation.ParametersAreNonnullByDefault; @@ -9,7 +11,6 @@ import io.github.thebusybiscuit.slimefun4.api.events.SlimefunItemRegistryFinalizedEvent; import net.guizhanss.fastmachines.FastMachines; -import net.guizhanss.fastmachines.items.machines.generic.AbstractFastMachine; public class SlimefunRegistryLoadedListener implements Listener { @@ -20,6 +21,13 @@ public SlimefunRegistryLoadedListener(@Nonnull FastMachines plugin) { @EventHandler public void onRegistryLoaded(@Nonnull SlimefunItemRegistryFinalizedEvent e) { - FastMachines.getRegistry().getAllEnabledFastMachines().forEach(AbstractFastMachine::registerRecipes); + FastMachines.getRegistry().getAllEnabledFastMachines().forEach(machine -> { + FastMachines.debug("Registering recipes for {0}", machine.getClass().getSimpleName()); + try { + machine.registerRecipes(); + } catch (Exception ex) { + FastMachines.log(Level.SEVERE, ex, "An error has occurred while registering recipes for {0}", machine.getClass().getSimpleName()); + } + }); } }