quick fix : Constant conditions & exceptions

This commit is contained in:
Alexdoru authored and Jason Mitchell committed 2023-01-28 18:02:41 -08:00
1 parent 2b6b01314d
commit d12e70dd52
4 files changed
+46 -61

No files matched your search

@@ -141,14 +141,12 @@ public class BlockLandmine extends BlockContainer {
&& (!explodeOnBroken || !hasItems(par1World, par2, par3, par4))
&& par6 != 193
&& !tileentity.isExploding) {
if (this != null) {
ItemStack is = new ItemStack(this, 1, damageDropped(tileentity.triggerType));
if (tileentity.hasCustomInventoryName()) {
is.setStackDisplayName(tileentity.getInventoryName());
}
dropBlockAsItem(
par1World, par2, par3, par4, new ItemStack(this, 1, damageDropped(tileentity.triggerType)));
ItemStack is = new ItemStack(this, 1, damageDropped(tileentity.triggerType));
if (tileentity.hasCustomInventoryName()) {
is.setStackDisplayName(tileentity.getInventoryName());
}
dropBlockAsItem(
par1World, par2, par3, par4, new ItemStack(this, 1, damageDropped(tileentity.triggerType)));
for (int j1 = 0; j1 < tileentity.getSizeInventory(); ++j1) {
ItemStack itemstack = tileentity.getStackInSlot(j1);
@@ -174,7 +174,7 @@ public class ContainerLandmine extends Container {
if ((par3 == 0 || par3 == 1) && (par2 == 0 || par2 == 1)) {
if (par1 == -999) {
if (inventoryplayer.getItemStack() != null && par1 == -999) {
if (inventoryplayer.getItemStack() != null) {
if (par2 == 0) {
par4EntityPlayer.dropPlayerItemWithRandomChoice(inventoryplayer.getItemStack(), false);
inventoryplayer.setItemStack(null);
@@ -205,9 +205,7 @@ public class ContainerLandmine extends Container {
localObject2 = itemstack1.getItem();
itemstack = itemstack1.copy();
if (slot2 != null
&& slot2.getStack() != null
&& slot2.getStack().getItem() == localObject2) {
if (slot2.getStack() != null && slot2.getStack().getItem() == localObject2) {
this.retrySlotClick(par1, par2, true, par4EntityPlayer);
}
}
@@ -244,11 +242,8 @@ public class ContainerLandmine extends Container {
if (itemstack4.stackSize == 0) {
inventoryplayer.setItemStack(null);
}
} else if (shouldDoStuff
&& slot2 instanceof SlotBehavedOnly
&& itemstack4 != null
&& slot2.isItemValid(
new ItemStack(itemstack4.getItem(), 1, itemstack4.getItemDamage()))) {
} else if (shouldDoStuff && itemstack4 != null && slot2.isItemValid(
new ItemStack(itemstack4.getItem(), 1, itemstack4.getItemDamage()))) {
k1 = par2 == 0 ? 1 : 1;
if (k1 > slot2.getSlotStackLimit()) {