From ba8cc49b6e7fc5b2a5740a018e3dd094a374f595 Mon Sep 17 00:00:00 2001 From: Kyle Einstein Date: Wed, 22 Sep 2021 20:43:15 -0400 Subject: [PATCH] Allow admins to control the behavior of the Electric Gold Pan via the legacy-gold-pan configuration option. --- .../items/electric/machines/ElectricGoldPan.java | 7 ++++++- src/main/resources/config.yml | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricGoldPan.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricGoldPan.java index a007e7e04..5afcbb037 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricGoldPan.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricGoldPan.java @@ -14,6 +14,7 @@ import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; import io.github.thebusybiscuit.slimefun4.core.attributes.RecipeDisplayItem; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.items.tools.GoldPan; import io.github.thebusybiscuit.slimefun4.implementation.items.tools.NetherGoldPan; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; @@ -40,9 +41,13 @@ public class ElectricGoldPan extends AContainer implements RecipeDisplayItem { private final ItemStack gravel = new ItemStack(Material.GRAVEL); private final ItemStack soulSand = new ItemStack(Material.SOUL_SAND); + private final boolean legacyMode; + @ParametersAreNonnullByDefault public ElectricGoldPan(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(itemGroup, item, recipeType, recipe); + + legacyMode = Slimefun.getCfg().getBoolean("options.legacy-gold-pan"); } @Override @@ -62,7 +67,7 @@ public class ElectricGoldPan extends AContainer implements RecipeDisplayItem { @Override protected MachineRecipe findNextRecipe(BlockMenu menu) { - if (!hasFreeSlot(menu)) { + if (!legacyMode && !hasFreeSlot(menu)) { return null; } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index f120d40e6..0a59963ad 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -13,6 +13,7 @@ options: legacy-ore-washer: false legacy-dust-washer: false legacy-ore-grinder: true + legacy-gold-pan: false language: en enable-translations: true log-duplicate-block-entries: true