quick fix : Simplifiable conditional expression

This commit is contained in:
Alexdoru committed 2023-01-26 01:32:56 +01:00
1 parent 22e4567f01
commit d8bb76367a
9 files changed
+20 -34

No files matched your search

@@ -165,11 +165,9 @@ public class TileEntityLandmine extends TileEntity implements IInventory {
@Override
public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) {
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this
? false
: par1EntityPlayer.getDistanceSq(
(double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D)
<= 64.0D;
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) == this && par1EntityPlayer.getDistanceSq(
(double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D)
<= 64.0D;
}
@Override
@@ -25,7 +25,7 @@ public class GlassBlock extends TConstructBlock {
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
Block i1 = par1IBlockAccess.getBlock(par2, par3, par4);
return i1 == (Block) this ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
return i1 != this && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
}
@Override
@@ -526,7 +526,7 @@ public class GlassBlockConnected extends MantleBlock {
@Override
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
Block b = par1IBlockAccess.getBlock(par2, par3, par4);
return b == (Block) this ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
return b != this && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
}
@Override
@@ -48,7 +48,7 @@ public class GlassBlockStained extends TConstructBlock {
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
Block block = world.getBlock(x, y, z);
return block == this ? false : super.shouldSideBeRendered(world, x, y, z, side);
return block != this && super.shouldSideBeRendered(world, x, y, z, side);
}
@Override
@@ -91,7 +91,7 @@ public class LavaTankBlock extends BlockContainer {
@Override
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
Block bID = world.getBlock(x, y, z);
return bID == this ? false : super.shouldSideBeRendered(world, x, y, z, side);
return bID != this && super.shouldSideBeRendered(world, x, y, z, side);
}
@Override
@@ -103,7 +103,7 @@ public class LavaTankBlock extends BlockContainer {
@Override
public int getLightValue(IBlockAccess world, int x, int y, int z) {
TileEntity logic = world.getTileEntity(x, y, z);
if (logic != null && logic instanceof LavaTankLogic) return ((LavaTankLogic) logic).getBrightness();
if (logic instanceof LavaTankLogic) return ((LavaTankLogic) logic).getBrightness();
return 0;
}
@@ -29,27 +29,15 @@ public class BattlesignBlock extends EquipBlock {
@Override
public boolean shouldSideBeRendered(
IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
return p_149646_5_ == 0 && this.minY > 0.0D
? true
: (p_149646_5_ == 1 && this.maxY < 1.0D
? true
: (p_149646_5_ == 2 && this.minZ > 0.0D
? true
: (p_149646_5_ == 3 && this.maxZ < 1.0D
? true
: (p_149646_5_ == 4 && this.minX > 0.0D
? true
: (p_149646_5_ == 5 && this.maxX < 1.0D
? true
: !(p_149646_1_
.getBlock(p_149646_2_, p_149646_3_, p_149646_4_)
.isOpaqueCube()
&& p_149646_1_
.getBlock(
p_149646_2_,
p_149646_3_ + 1,
p_149646_4_)
.isOpaqueCube()))))));
return p_149646_5_ == 0 && this.minY > 0.0D || (p_149646_5_ == 1 && this.maxY < 1.0D || (p_149646_5_ == 2 && this.minZ > 0.0D || (p_149646_5_ == 3 && this.maxZ < 1.0D || (p_149646_5_ == 4 && this.minX > 0.0D || (p_149646_5_ == 5 && this.maxX < 1.0D || !(p_149646_1_
.getBlock(p_149646_2_, p_149646_3_, p_149646_4_)
.isOpaqueCube()
&& p_149646_1_
.getBlock(
p_149646_2_,
p_149646_3_ + 1,
p_149646_4_)
.isOpaqueCube()))))));
}
@Override
@@ -44,7 +44,7 @@ public abstract class EquipLogic extends InventoryLogic {
@Override
public boolean isStackInSlot(int slot) {
return slot != 0 ? inventory[slot] != null : false;
return slot != 0 && inventory[slot] != null;
}
@Override
@@ -307,7 +307,7 @@ public class FurnaceLogic extends InventoryLogic implements IActiveLogic, IFacin
@Override
public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) {
return par1 == 2 ? false : (par1 == 1 ? isItemFuel(par2ItemStack) : true);
return par1 != 2 && (par1 != 1 || isItemFuel(par2ItemStack));
}
@Override
@@ -902,7 +902,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
*/
@Override
public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) {
return this.isDead ? false : par1EntityPlayer.getDistanceSqToEntity(this) <= 64.0D;
return !this.isDead && par1EntityPlayer.getDistanceSqToEntity(this) <= 64.0D;
}
/**