Skip to content

Commit

Permalink
Merge pull request #48 from chochem/add-null-check
Browse files Browse the repository at this point in the history
Add a couple of null checks
  • Loading branch information
chochem authored Sep 11, 2024
2 parents c2cafd4 + 3ff6e91 commit 6429eea
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
18 changes: 10 additions & 8 deletions src/main/java/magicbees/main/utils/CraftingManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
new ItemStack(item.getItem(), 1, item.getItemDamage()),
list.copy().add(Aspect.CRYSTAL, 2));
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");
Expand Down

0 comments on commit 6429eea

Please sign in to comment.