mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
Fix more nulls in recipes
This commit is contained in:
3 files changed
+6
-6
No files matched your search
@@ -65,7 +65,7 @@ public class CompositeLensRecipe implements IRecipe {
|
||||
|
||||
if(lens.getItem() instanceof ICompositableLens) {
|
||||
ICompositableLens lensItem = (ICompositableLens) lens.getItem();
|
||||
if(secondLens.isEmpty() || !lensItem.canCombineLenses(lens, secondLens) || lensItem.getCompositeLens(lens) != null || lensItem.getCompositeLens(secondLens) != null)
|
||||
if(secondLens.isEmpty() || !lensItem.canCombineLenses(lens, secondLens) || !lensItem.getCompositeLens(lens).isEmpty() || !lensItem.getCompositeLens(secondLens).isEmpty())
|
||||
return ItemStack.EMPTY;
|
||||
|
||||
ItemStack lensCopy = lens.copy();
|
||||
|
||||
@@ -34,7 +34,7 @@ public class CosmeticAttachRecipe implements IRecipe {
|
||||
if(stack.getItem() instanceof ICosmeticBauble && !foundCosmetic)
|
||||
foundCosmetic = true;
|
||||
else if(!foundAttachable) {
|
||||
if(stack.getItem() instanceof ICosmeticAttachable && !(stack.getItem() instanceof ICosmeticBauble) && ((ICosmeticAttachable) stack.getItem()).getCosmeticItem(stack) == null)
|
||||
if(stack.getItem() instanceof ICosmeticAttachable && !(stack.getItem() instanceof ICosmeticBauble) && ((ICosmeticAttachable) stack.getItem()).getCosmeticItem(stack).isEmpty())
|
||||
foundAttachable = true;
|
||||
else return false;
|
||||
}
|
||||
@@ -53,7 +53,7 @@ public class CosmeticAttachRecipe implements IRecipe {
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() instanceof ICosmeticBauble && cosmeticItem == null)
|
||||
if(stack.getItem() instanceof ICosmeticBauble && cosmeticItem.isEmpty())
|
||||
cosmeticItem = stack;
|
||||
else attachableItem = stack;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class CosmeticRemoveRecipe implements IRecipe {
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() instanceof ICosmeticAttachable && !(stack.getItem() instanceof ICosmeticBauble) && ((ICosmeticAttachable) stack.getItem()).getCosmeticItem(stack) != null)
|
||||
if(stack.getItem() instanceof ICosmeticAttachable && !(stack.getItem() instanceof ICosmeticBauble) && !((ICosmeticAttachable) stack.getItem()).getCosmeticItem(stack).isEmpty())
|
||||
foundAttachable = true;
|
||||
else return false;
|
||||
}
|
||||
@@ -51,11 +51,11 @@ public class CosmeticRemoveRecipe implements IRecipe {
|
||||
}
|
||||
|
||||
ICosmeticAttachable attachable = (ICosmeticAttachable) attachableItem.getItem();
|
||||
if(attachable.getCosmeticItem(attachableItem) == null)
|
||||
if(attachable.getCosmeticItem(attachableItem).isEmpty())
|
||||
return ItemStack.EMPTY;
|
||||
|
||||
ItemStack copy = attachableItem.copy();
|
||||
attachable.setCosmeticItem(copy, null);
|
||||
attachable.setCosmeticItem(copy, ItemStack.EMPTY);
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user