quick fix : 'if' statement with identical branches

This commit is contained in:
Alexdoru authored and Jason Mitchell committed 2023-01-28 18:02:41 -08:00
1 parent 04c7d32b53
commit fc54dde7ce
16 files changed
+39 -84

No files matched your search

@@ -461,17 +461,15 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa
l = 64 - stack.stackSize;
}
if (l == 0) {
return stackSize;
} else {
if (l != 0) {
stackSize -= l;
stack.stackSize += l;
living.setCurrentItemOrArmor(slotID, stack);
if (living instanceof EntityLiving)
if (living instanceof EntityLiving) {
((EntityLiving) living).setEquipmentDropChance(slotID, 2.0f);
return stackSize;
}
}
return stackSize;
}
}
}
@@ -70,23 +70,14 @@ public class InventoryCraftingStation extends InventoryCrafting {
ItemStack stack = logic.getStackInSlot(slotID + 1);
if (stack != null) {
ItemStack itemstack;
if (stack.stackSize <= par2) {
itemstack = stack.copy();
stack = null;
logic.setInventorySlotContents(slotID + 1, null);
this.eventHandler.onCraftMatrixChanged(this);
return itemstack;
} else {
itemstack = stack.splitStack(par2);
if (stack.stackSize == 0) {
stack = null;
}
this.eventHandler.onCraftMatrixChanged(this);
return itemstack;
}
this.eventHandler.onCraftMatrixChanged(this);
return itemstack;
} else {
return null;
}
@@ -171,15 +171,12 @@ public class FrypanLogic extends EquipLogic implements IActiveLogic {
}
public ItemStack getResultFor(ItemStack stack) {
if (stack == null) {
return null;
} else {
if (stack != null) {
ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(stack);
if (result != null && result.getItem() instanceof ItemFood) // Only valid for food
return result.copy();
return null;
return result.copy();
}
return null;
}
public static int getItemBurnTime(ItemStack stack) {