Fix more nulls in recipes

This commit is contained in:
Vincent Lee committed 2017-01-09 13:27:27 -06:00
1 parent 758f58f692
commit af13e55dc5
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;
}