From 0674660621288924056197b31612585787bce5e9 Mon Sep 17 00:00:00 2001 From: SchnTgaiSpock Date: Mon, 4 Nov 2024 20:26:03 -0500 Subject: [PATCH] more unit tests --- .../api/recipes/AbstractRecipeInput.java | 4 + .../slimefun4/api/recipes/Recipe.java | 14 +- .../api/recipes/items/RecipeInputGroup.java | 2 +- .../api/recipes/items/RecipeInputItem.java | 7 +- .../recipes/items/RecipeInputItemStack.java | 17 +- .../items/RecipeInputSlimefunItem.java | 12 +- .../api/recipes/items/RecipeInputTag.java | 11 +- .../recipes/items/RecipeOutputItemStack.java | 10 - .../items/RecipeOutputSlimefunItem.java | 5 - .../recipes/matching/InputMatchResult.java | 40 ++++ .../api/recipes/matching/ItemMatchResult.java | 10 +- .../api/recipes/matching/MatchProcedure.java | 49 +---- .../slimefun4/api/recipes/TestRecipes.java | 201 +++++++++++++++++- 13 files changed, 307 insertions(+), 75 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/AbstractRecipeInput.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/AbstractRecipeInput.java index 3d82c2654a..c558305c2d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/AbstractRecipeInput.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/AbstractRecipeInput.java @@ -42,6 +42,10 @@ public InputMatchResult match(List givenItems) { return getMatchProcedure().match(this, givenItems); } + public InputMatchResult matchAs(MatchProcedure match, List givenItems) { + return match.match(this, givenItems); + } + @Override public abstract String toString(); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/Recipe.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/Recipe.java index ca61c1ad7c..9677b5b925 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/Recipe.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/Recipe.java @@ -16,6 +16,7 @@ import io.github.thebusybiscuit.slimefun4.api.recipes.items.RecipeOutputItemStack; import io.github.thebusybiscuit.slimefun4.api.recipes.matching.InputMatchResult; +import io.github.thebusybiscuit.slimefun4.api.recipes.matching.MatchProcedure; import io.github.thebusybiscuit.slimefun4.api.recipes.matching.RecipeMatchResult; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; @@ -59,11 +60,11 @@ public static Recipe fromItemStacks(String id, ItemStack[] inputs, ItemStack out ); } - public static Recipe fromItemStacks(ItemStack[] inputs, ItemStack output, int width, RecipeType type) { + public static Recipe fromItemStacks(ItemStack[] inputs, ItemStack output, RecipeType type, MatchProcedure match) { return new Recipe( Optional.empty(), "other_recipes", - RecipeInput.fromItemStacks(inputs, type.getDefaultMatchProcedure()), + RecipeInput.fromItemStacks(inputs, match), new RecipeOutput(List.of(new RecipeOutputItemStack(output))), List.of(type), Optional.empty(), @@ -72,6 +73,10 @@ public static Recipe fromItemStacks(ItemStack[] inputs, ItemStack output, int wi ); } + public static Recipe fromItemStacks(ItemStack[] inputs, ItemStack output, RecipeType type) { + return fromItemStacks(inputs, output, type, type.getDefaultMatchProcedure()); + } + public Optional getId() { return id; @@ -129,6 +134,11 @@ public RecipeMatchResult match(List givenItems) { return new RecipeMatchResult(this, result); } + public RecipeMatchResult matchAs(MatchProcedure match, List givenItems) { + InputMatchResult result = getInput().matchAs(match, givenItems); + return new RecipeMatchResult(this, result); + } + @Override public String toString() { StringBuilder builder = new StringBuilder("Recipe { "); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputGroup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputGroup.java index da636f5963..7d3f2bd5f9 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputGroup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputGroup.java @@ -35,7 +35,7 @@ public ItemMatchResult matchItem(ItemStack item, AbstractRecipeInputItem root) { return result; } } - return new ItemMatchResult(false, root, item); + return new ItemMatchResult(false, root, item, 0); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputItem.java index dd1d368388..6f219a3915 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputItem.java @@ -19,7 +19,7 @@ public abstract class RecipeInputItem extends AbstractRecipeInputItem { @Override protected ItemMatchResult matchItem(ItemStack item, AbstractRecipeInputItem root) { - return new ItemMatchResult(item == null || item.getType().isAir(), this, item); + return new ItemMatchResult(item == null || item.getType().isAir(), this, item, 0); } @Override @@ -63,11 +63,6 @@ public JsonElement serialize(JsonSerializationContext context) { private int amount; private int durabilityCost = 0; - public RecipeInputItem(int amount, int durabilityCost, double consumeChance) { - this.amount = amount; - this.durabilityCost = durabilityCost; - } - public RecipeInputItem(int amount, int durabilityCost) { this.amount = amount; this.durabilityCost = durabilityCost; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputItemStack.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputItemStack.java index f0af6da2d1..97ee654be4 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputItemStack.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputItemStack.java @@ -24,6 +24,11 @@ public RecipeInputItemStack(ItemStack template, int durabilityCost) { this.template = template; } + @ParametersAreNonnullByDefault + public RecipeInputItemStack(ItemStack template) { + this(template, 0); + } + @ParametersAreNonnullByDefault public RecipeInputItemStack(Material template, int amount, int durabilityCost) { super(amount, durabilityCost); @@ -36,8 +41,8 @@ public RecipeInputItemStack(Material template, int amount) { } @ParametersAreNonnullByDefault - public RecipeInputItemStack(ItemStack template) { - this(template, 0); + public RecipeInputItemStack(Material template) { + this(template, 1); } @Nonnull @@ -46,10 +51,14 @@ public RecipeInputItemStack(ItemStack template) { @Override public ItemMatchResult matchItem(ItemStack item, AbstractRecipeInputItem root) { + if (item == null || item.getType().isAir()) { + return new ItemMatchResult(isEmpty(), root, item, getAmount()); + } else if (item.getAmount() < getAmount()) { + return new ItemMatchResult(false, root, item, getAmount()); + } return new ItemMatchResult( SlimefunUtils.isItemSimilar(item, template, false), - root, - item + root, item, getAmount() ); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputSlimefunItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputSlimefunItem.java index 31ca3ebac6..b57049d1d0 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputSlimefunItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputSlimefunItem.java @@ -24,15 +24,23 @@ public RecipeInputSlimefunItem(String slimefunId, int amount) { this(slimefunId, amount, 0); } + public RecipeInputSlimefunItem(String slimefunId) { + this(slimefunId, 1); + } + public String getSlimefunId() { return slimefunId; } public void setSlimefunId(String slimefunId) { this.slimefunId = slimefunId; } @Override public ItemMatchResult matchItem(ItemStack item, AbstractRecipeInputItem root) { + if (item == null || item.getType().isAir()) { + return new ItemMatchResult(isEmpty(), root, item, getAmount()); + } else if (item.getAmount() < getAmount()) { + return new ItemMatchResult(false, root, item, getAmount()); + } return new ItemMatchResult( SlimefunUtils.isItemSimilar(item, SlimefunItem.getById(slimefunId).getItem(), false), - root, - item + root, item, getAmount() ); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputTag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputTag.java index a0828f0203..befa1884d4 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputTag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeInputTag.java @@ -30,22 +30,27 @@ public RecipeInputTag(Tag tag) { this(tag, 1); } + public Tag getTag() { return tag; } public void setTag(Tag tag) { this.tag = tag; } @Override public ItemMatchResult matchItem(ItemStack item, AbstractRecipeInputItem root) { + if (item == null || item.getType().isAir()) { + return new ItemMatchResult(isEmpty(), root, item, getAmount()); + } else if (item.getAmount() < getAmount()) { + return new ItemMatchResult(false, root, item, getAmount()); + } for (Material mat : tag.getValues()) { ItemStack template = new ItemStack(mat); if (SlimefunUtils.isItemSimilar(item, template, true)) { return new ItemMatchResult( SlimefunUtils.isItemSimilar(item, template, false), - root, - item + root, item, getAmount() ); } } - return new ItemMatchResult(false, root, item); + return new ItemMatchResult(false, root, item, getAmount()); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeOutputItemStack.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeOutputItemStack.java index 0b4ac19c9f..0c32d60d0f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeOutputItemStack.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeOutputItemStack.java @@ -15,21 +15,11 @@ public class RecipeOutputItemStack extends RecipeOutputItem { private ItemStack template; - public RecipeOutputItemStack(ItemStack template, double consumeChance) { - super(template.getAmount(), consumeChance); - this.template = template; - } - public RecipeOutputItemStack(ItemStack template) { super(template.getAmount()); this.template = template; } - public RecipeOutputItemStack(Material template, int amount, double consumeChance) { - super(amount, consumeChance); - this.template = new ItemStack(template, amount); - } - public RecipeOutputItemStack(Material template, int amount) { super(amount); this.template = new ItemStack(template, amount); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeOutputSlimefunItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeOutputSlimefunItem.java index eaf9b0d90b..e83d43bb3c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeOutputSlimefunItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/items/RecipeOutputSlimefunItem.java @@ -16,11 +16,6 @@ public class RecipeOutputSlimefunItem extends RecipeOutputItem { private String slimefunId; - public RecipeOutputSlimefunItem(String slimefunId, int amount, double consumeChance) { - super(amount, consumeChance); - this.slimefunId = slimefunId; - } - public RecipeOutputSlimefunItem(String slimefunId, int amount) { super(amount); this.slimefunId = slimefunId; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/matching/InputMatchResult.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/matching/InputMatchResult.java index 29c8973beb..1ff05b3622 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/matching/InputMatchResult.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/matching/InputMatchResult.java @@ -3,6 +3,8 @@ import java.util.Collections; import java.util.List; +import org.bukkit.inventory.ItemStack; + import io.github.thebusybiscuit.slimefun4.api.recipes.AbstractRecipeInput; public class InputMatchResult { @@ -10,11 +12,20 @@ public class InputMatchResult { private final AbstractRecipeInput input; private final List itemMatchResults; private final boolean itemsMatch; + private int possibleCrafts; public InputMatchResult(AbstractRecipeInput input, List itemMatchResults, boolean itemsMatch) { this.input = input; this.itemMatchResults = itemMatchResults; this.itemsMatch = itemsMatch; + possibleCrafts = 2147483647; + for (ItemMatchResult res : itemMatchResults) { + ItemStack item = res.getMatchedItem(); + if (item == null || res.getRecipeItem().isEmpty()) { + continue; + } + possibleCrafts = Math.min(possibleCrafts, item.getAmount() / res.getConsumeAmount()); + } } public InputMatchResult(AbstractRecipeInput input, List itemMatchResults) { @@ -33,6 +44,10 @@ public boolean itemsMatch() { public AbstractRecipeInput getInput() { return input; } + + public int getPossibleCrafts() { + return possibleCrafts; + } /** * IMPORTANT If itemsMatch() is false, then not all match results may be present @@ -44,5 +59,30 @@ public List getItemMatchResults() { public boolean itemsMatch() { return itemsMatch; } + + /** + * Consumes the items that were used in matching + * the recipe, based on the amount of input required + * in the recipe. + * @param amount Number of times to consume. May + * be less if there are not enough items. + * @return How many times the inputs were actually consumed + */ + public int consumeItems(int amount) { + if (possibleCrafts == 0 || amount == 0) { + return 0; + } + + int amountToCraft = Math.min(possibleCrafts, amount); + for (ItemMatchResult res : itemMatchResults) { + ItemStack item = res.getMatchedItem(); + if (item == null || res.getRecipeItem().isEmpty()) { + continue; + } + item.setAmount(item.getAmount() - amountToCraft * res.getConsumeAmount()); + } + possibleCrafts -= amountToCraft; + return amountToCraft; + } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/matching/ItemMatchResult.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/matching/ItemMatchResult.java index b92a274a61..4405be3066 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/matching/ItemMatchResult.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/matching/ItemMatchResult.java @@ -11,11 +11,13 @@ public class ItemMatchResult { private final boolean itemsMatch; private final AbstractRecipeInputItem recipeItem; private final @Nullable ItemStack matchedItem; + private final int consumeAmount; - public ItemMatchResult(boolean itemsMatch, AbstractRecipeInputItem recipeItem, ItemStack matchedItem) { + public ItemMatchResult(boolean itemsMatch, AbstractRecipeInputItem recipeItem, ItemStack matchedItem, int consumeAmount) { this.itemsMatch = itemsMatch; this.recipeItem = recipeItem; this.matchedItem = matchedItem; + this.consumeAmount = consumeAmount; } /** @@ -31,5 +33,11 @@ public ItemMatchResult(boolean itemsMatch, AbstractRecipeInputItem recipeItem, I */ @Nullable public ItemStack getMatchedItem() { return matchedItem; } + /** + * @return How much of the item to consume when crafting + */ + public int getConsumeAmount() { + return consumeAmount; + } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/matching/MatchProcedure.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/matching/MatchProcedure.java index 1e9c4353bd..825455a186 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/matching/MatchProcedure.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/matching/MatchProcedure.java @@ -25,11 +25,6 @@ public abstract class MatchProcedure { public InputMatchResult match(AbstractRecipeInput recipeInput, List givenItems) { return InputMatchResult.noMatch(recipeInput); } - - @Override - public String toString() { - return "DUMMY"; - } }; /** @@ -40,11 +35,6 @@ public String toString() { public InputMatchResult match(AbstractRecipeInput recipeInput, List givenItems) { return new InputMatchResult(recipeInput, Collections.emptyList(), true); } - - @Override - public String toString() { - return "EMPTY"; - } }; public static final MatchProcedure SHAPED = new MatchProcedure("slimefun:shaped") { @@ -58,7 +48,7 @@ public InputMatchResult match(AbstractRecipeInput recipeInput, List g return InputMatchResult.noMatch(recipeInput); } BoundingBox recipeBox = oRecipeBox.get(); - BoundingBox givenBox = RecipeUtils.calculateBoundingBox(List.of(givenItems), width, height); + BoundingBox givenBox = RecipeUtils.calculateBoundingBox(givenItems, width, height, i -> i == null || i.getType().isAir()); if (!recipeBox.isSameShape(givenBox)) { return InputMatchResult.noMatch(recipeInput); @@ -80,11 +70,6 @@ public InputMatchResult match(AbstractRecipeInput recipeInput, List g } return new InputMatchResult(recipeInput, results, true); } - - @Override - public String toString() { - return "SHAPED"; - } }; public static final MatchProcedure SHAPED_FLIPPABLE = new MatchProcedure("slimefun:shaped_flippable") { @@ -98,11 +83,6 @@ public InputMatchResult match(AbstractRecipeInput recipeInput, List g List flipped = RecipeUtils.flipY(givenItems, recipeInput.getWidth(), recipeInput.getHeight()); return SHAPED.match(recipeInput, flipped); } - - @Override - public String toString() { - return "SHAPED_FLIPPABLE"; - } }; public static final MatchProcedure SHAPED_ROTATABLE_45_3X3 = new MatchProcedure("slimefun:shaped_rotatable_3x3") { @@ -118,11 +98,6 @@ public InputMatchResult match(AbstractRecipeInput recipeInput, List g } return result; } - - @Override - public String toString() { - return "SHAPED_ROTATABLE_3X3"; - } }; public static final MatchProcedure SUBSET = new MatchProcedure("slimefun:subset") { @@ -136,6 +111,9 @@ public InputMatchResult match(AbstractRecipeInput recipeInput, List g } Map matchedItems = new HashMap<>(); outer: for (AbstractRecipeInputItem recipeItem : recipeInput.getItems()) { + if (recipeItem.isEmpty()) { + continue; + } for (int i = 0; i < givenItems.size(); i++) { if (matchedItems.containsKey(i)) { continue; @@ -152,29 +130,19 @@ public InputMatchResult match(AbstractRecipeInput recipeInput, List g return new InputMatchResult(recipeInput, List.copyOf(matchedItems.values()), true); } - - @Override - public String toString() { - return "SUBSET"; - } }; public static final MatchProcedure SHAPELESS = new MatchProcedure("slimefun:shapeless") { @Override public InputMatchResult match(AbstractRecipeInput recipeInput, List givenItems) { if ( - recipeInput.getItems().stream().filter(i -> !i.isEmpty()).count() > + recipeInput.getItems().stream().filter(i -> !i.isEmpty()).count() != givenItems.stream().filter(i -> i != null && !i.getType().isAir()).count() - ) { + ) { return InputMatchResult.noMatch(recipeInput); } return SUBSET.match(recipeInput, givenItems); } - - @Override - public String toString() { - return "SHAPELESS"; - } }; private final NamespacedKey key; @@ -195,5 +163,10 @@ public InputMatchResult match(AbstractRecipeInput recipeInput, ItemStack[] given public boolean recipeShouldSaveBoundingBox() { return true; } + + @Override + public String toString() { + return key.toString(); + } } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/recipes/TestRecipes.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/recipes/TestRecipes.java index 6b4c0e52cd..97c0bec542 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/recipes/TestRecipes.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/recipes/TestRecipes.java @@ -4,6 +4,7 @@ import java.util.List; import org.bukkit.Material; +import org.bukkit.NamespacedKey; import org.bukkit.Tag; import org.bukkit.inventory.ItemStack; import org.junit.jupiter.api.AfterAll; @@ -16,6 +17,8 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import io.github.bakedlibs.dough.items.CustomItemStack; +import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; import io.github.thebusybiscuit.slimefun4.api.recipes.items.AbstractRecipeInputItem; import io.github.thebusybiscuit.slimefun4.api.recipes.items.AbstractRecipeOutputItem; import io.github.thebusybiscuit.slimefun4.api.recipes.items.RecipeInputGroup; @@ -26,12 +29,15 @@ import io.github.thebusybiscuit.slimefun4.api.recipes.items.RecipeOutputGroup; import io.github.thebusybiscuit.slimefun4.api.recipes.items.RecipeOutputItemStack; import io.github.thebusybiscuit.slimefun4.api.recipes.items.RecipeOutputSlimefunItem; +import io.github.thebusybiscuit.slimefun4.api.recipes.items.RecipeOutputTag; import io.github.thebusybiscuit.slimefun4.api.recipes.json.RecipeSerDes; +import io.github.thebusybiscuit.slimefun4.api.recipes.matching.MatchProcedure; import io.github.thebusybiscuit.slimefun4.api.recipes.json.RecipeInputSerDes; import io.github.thebusybiscuit.slimefun4.api.recipes.json.RecipeInputItemSerDes; import io.github.thebusybiscuit.slimefun4.api.recipes.json.RecipeOutputSerDes; import io.github.thebusybiscuit.slimefun4.api.recipes.json.RecipeOutputItemSerDes; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; +import io.github.thebusybiscuit.slimefun4.test.mocks.MockSlimefunItem; import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; import be.seeseemelk.mockbukkit.MockBukkit; @@ -118,12 +124,15 @@ class TestRecipes { } """; + private static Slimefun sf; private static Gson gson; + private static ItemGroup itemGroup; + private static MockSlimefunItem testItem; @BeforeAll public static void load() { MockBukkit.mock(); - MockBukkit.load(Slimefun.class); + sf = MockBukkit.load(Slimefun.class); gson = new GsonBuilder() .registerTypeAdapter(Recipe.class, new RecipeSerDes()) .registerTypeAdapter(AbstractRecipeInput.class, new RecipeInputSerDes()) @@ -131,6 +140,10 @@ public static void load() { .registerTypeAdapter(AbstractRecipeInputItem.class, new RecipeInputItemSerDes()) .registerTypeAdapter(AbstractRecipeOutputItem.class, new RecipeOutputItemSerDes()) .create(); + + itemGroup = new ItemGroup(new NamespacedKey(sf, "test_group"), new CustomItemStack(Material.DIAMOND_AXE, "Test Group")); + testItem = new MockSlimefunItem(itemGroup, new ItemStack(Material.IRON_INGOT), "TEST_ITEM"); + testItem.register(sf); } @AfterAll @@ -223,7 +236,6 @@ private boolean isGroupInput(List items, List