quick fix : Redundant 'if' statement

This commit is contained in:
Alexdoru committed 2023-01-25 23:11:58 +01:00
1 parent ce3ee201a3
commit d0c3b57e22
29 files changed
+48 -130

No files matched your search

@@ -57,12 +57,9 @@ public class TActiveOmniMod extends ActiveToolMod {
public boolean beforeBlockBreak(ToolCore tool, ItemStack stack, int x, int y, int z, EntityLivingBase entity) {
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
baconator(tool, stack, entity, tags);
if (entity instanceof EntityPlayer && ((EntityPlayer) entity).capabilities.isCreativeMode) return false;
TinkerTools.modLapis.midStreamModify(stack, tool);
if (autoSmelt(tool, tags, stack, x, y, z, entity)) return true;
return false;
return autoSmelt(tool, tags, stack, x, y, z, entity);
}
@Override
@@ -294,7 +291,6 @@ public class TActiveOmniMod extends ActiveToolMod {
ItemStack stack,
EntityLivingBase player,
Entity entity) {
if (tool == TinkerTools.cutlass && random.nextInt(10) == 0) return true;
return false;
return tool == TinkerTools.cutlass && random.nextInt(10) == 0;
}
}
@@ -37,7 +37,6 @@ public class FancyEntityItem extends EntityItem {
}
public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) {
if (par1DamageSource.getDamageType().equals("outOfWorld")) return true;
return false;
return par1DamageSource.getDamageType().equals("outOfWorld");
}
}
@@ -270,11 +270,7 @@ public class PartCrafterGui extends GuiContainer implements INEIGuiHandler {
@Override
public VisiblityData modifyVisiblity(GuiContainer gui, VisiblityData currentVisibility) {
if (width - xSize < 107) {
currentVisibility.showWidgets = false;
} else {
currentVisibility.showWidgets = true;
}
currentVisibility.showWidgets = width - xSize >= 107;
if (guiLeft < 58) {
currentVisibility.showStateButtons = false;
@@ -301,9 +297,6 @@ public class PartCrafterGui extends GuiContainer implements INEIGuiHandler {
@Override
public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h) {
if (y + h - 4 < guiTop || y + 4 > guiTop + ySize) return false;
if (x - w - 4 < guiLeft - 40 || x + 4 > guiLeft + xSize + DESC_WIDTH) return false;
return true;
return x - w - 4 >= guiLeft - 40 && x + 4 <= guiLeft + xSize + DESC_WIDTH;
}
}
@@ -183,10 +183,6 @@ public class StencilTableGui extends GuiContainer implements INEIGuiHandler {
}
// is it in the horizontal column of the left buttons?
if (x + w > this.buttonsLeftRect[0] && x < this.guiLeft && y + h > this.guiTop && y < this.buttonsLeftRect[1]) {
return true;
}
return false;
return x + w > this.buttonsLeftRect[0] && x < this.guiLeft && y + h > this.guiTop && y < this.buttonsLeftRect[1];
}
}
@@ -268,16 +268,10 @@ public class ToolStationGui extends GuiContainer implements INEIGuiHandler {
@Override
public VisiblityData modifyVisiblity(GuiContainer gui, VisiblityData currentVisibility) {
if (width - xSize < 107) {
currentVisibility.showWidgets = false;
} else {
currentVisibility.showWidgets = true;
}
currentVisibility.showWidgets = width - xSize >= 107;
if (guiLeft < 58) {
currentVisibility.showStateButtons = false;
}
return currentVisibility;
}
@@ -299,9 +293,6 @@ public class ToolStationGui extends GuiContainer implements INEIGuiHandler {
@Override
public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h) {
if (y + h - 4 < guiTop || y + 4 > guiTop + ySize) return false;
if (x - w - 4 < guiLeft - 40 || x + 4 > guiLeft + xSize + 126) return false;
return true;
return x - w - 4 >= guiLeft - 40 && x + 4 <= guiLeft + xSize + 126;
}
}
@@ -66,8 +66,7 @@ public class PartBuilderLogic extends InventoryLogic implements ISidedInventory
}
}
if (inventory[4] != null || inventory[5] != null) craftedTop = true;
else craftedTop = false;
craftedTop = inventory[4] != null || inventory[5] != null;
}
if (!craftedTop) buildTopPart();
@@ -84,8 +83,7 @@ public class PartBuilderLogic extends InventoryLogic implements ISidedInventory
}
}
if (inventory[6] != null || inventory[7] != null) craftedBottom = true;
else craftedBottom = false;
craftedBottom = inventory[6] != null || inventory[7] != null;
}
if (!craftedBottom) buildBottomPart();
@@ -91,8 +91,7 @@ public class StencilTableLogic extends InventoryLogic implements ISidedInventory
@Override
public boolean canDropInventorySlot(int slot) {
if (slot == 0) return true;
else return false;
return slot == 0;
}
@Override
@@ -32,8 +32,7 @@ public class ToolStationLogic extends InventoryLogic implements ISidedInventory
@Override
public boolean canDropInventorySlot(int slot) {
if (slot == 0) return false;
return true;
return slot != 0;
}
@Override