From 05476997e1440f4cdfa84d28f11f1e8cfc9b77cb Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Wed, 11 Sep 2024 17:58:27 +0100 Subject: [PATCH 1/3] add null check to allow duplicate apatite removal --- .../java/magicbees/main/utils/compat/ThaumcraftHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/magicbees/main/utils/compat/ThaumcraftHelper.java b/src/main/java/magicbees/main/utils/compat/ThaumcraftHelper.java index 34253bcb..23e483c3 100644 --- a/src/main/java/magicbees/main/utils/compat/ThaumcraftHelper.java +++ b/src/main/java/magicbees/main/utils/compat/ThaumcraftHelper.java @@ -638,9 +638,11 @@ private static void setupItemAspects() { new ItemStack(item.getItem(), 1, ForestryHelper.BlockResource.APATITE.ordinal()), list.copy()); item = ItemInterface.getItemStack(ForestryHelper.Name, "apatite"); - ThaumcraftApi.registerObjectTag( + if(item != null) { + ThaumcraftApi.registerObjectTag( new ItemStack(item.getItem(), 1, item.getItemDamage()), list.copy().add(Aspect.CRYSTAL, 2)); + } list = new AspectList().add(Aspect.MOTION, 2).add(Aspect.FLIGHT, 1); item = ItemInterface.getItemStack("beeDroneGE"); From cdf3046e61c7d68d874a98725712bc39413ab164 Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Wed, 11 Sep 2024 17:59:35 +0100 Subject: [PATCH 2/3] sa --- .../java/magicbees/main/utils/compat/ThaumcraftHelper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/magicbees/main/utils/compat/ThaumcraftHelper.java b/src/main/java/magicbees/main/utils/compat/ThaumcraftHelper.java index 23e483c3..16de4e84 100644 --- a/src/main/java/magicbees/main/utils/compat/ThaumcraftHelper.java +++ b/src/main/java/magicbees/main/utils/compat/ThaumcraftHelper.java @@ -638,10 +638,10 @@ private static void setupItemAspects() { new ItemStack(item.getItem(), 1, ForestryHelper.BlockResource.APATITE.ordinal()), list.copy()); item = ItemInterface.getItemStack(ForestryHelper.Name, "apatite"); - if(item != null) { + if (item != null) { ThaumcraftApi.registerObjectTag( - new ItemStack(item.getItem(), 1, item.getItemDamage()), - list.copy().add(Aspect.CRYSTAL, 2)); + new ItemStack(item.getItem(), 1, item.getItemDamage()), + list.copy().add(Aspect.CRYSTAL, 2)); } list = new AspectList().add(Aspect.MOTION, 2).add(Aspect.FLIGHT, 1); From 3ff6e910532c1958d3d1a151b3c48beb67c646e6 Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Wed, 11 Sep 2024 18:07:25 +0100 Subject: [PATCH 3/3] second null check --- .../magicbees/main/utils/CraftingManager.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/magicbees/main/utils/CraftingManager.java b/src/main/java/magicbees/main/utils/CraftingManager.java index d4d42e07..90e11fe3 100644 --- a/src/main/java/magicbees/main/utils/CraftingManager.java +++ b/src/main/java/magicbees/main/utils/CraftingManager.java @@ -426,14 +426,16 @@ private static void setupVanillaCrafting() { GameRegistry.addRecipe( new ShapedOreRecipe(new ItemStack(Items.emerald), "xxx", "xxx", "xxx", 'x', "nuggetEmerald")); - GameRegistry.addRecipe( - new ShapedOreRecipe( - ItemInterface.getItemStack("apatite"), - "xxx", - "xxx", - "xxx", - 'x', - Config.nuggets.getStackForType(NuggetType.APATITE))); + if (ItemInterface.getItemStack("apatite") != null) { + GameRegistry.addRecipe( + new ShapedOreRecipe( + ItemInterface.getItemStack("apatite"), + "xxx", + "xxx", + "xxx", + 'x', + Config.nuggets.getStackForType(NuggetType.APATITE))); + } output = Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY); GameRegistry.addRecipe(