diff --git a/src/main/java/cofh/lib/gui/element/ElementTextField.java b/src/main/java/cofh/lib/gui/element/ElementTextField.java index 4937ef4b..e1109aed 100644 --- a/src/main/java/cofh/lib/gui/element/ElementTextField.java +++ b/src/main/java/cofh/lib/gui/element/ElementTextField.java @@ -916,10 +916,8 @@ public void drawForeground(int mouseX, int mouseY) { int startX = posX + 1 - (multiline ? renderStartX : 0), endX = sizeX - 1; int startY = posY + 1 - renderStartY, endY = startY + font.FONT_HEIGHT; int drawY = renderStartY + Math.max(0, (sizeY - 2) / font.FONT_HEIGHT) * font.FONT_HEIGHT; - if (enableStencil) { - if (sizeY - (drawY - renderStartY) > 2) { - drawY += font.FONT_HEIGHT; - } + if (enableStencil && sizeY - (drawY - renderStartY) > 2) { + drawY += font.FONT_HEIGHT; } int drawX = endX + (multiline ? renderStartX : 0); for (int i = multiline ? 0 : renderStartX, width = 0, height = 0; i <= textLength; ++i) { diff --git a/src/main/java/cofh/lib/inventory/ComparableItemStackNBT.java b/src/main/java/cofh/lib/inventory/ComparableItemStackNBT.java index 778a3228..56f6bf05 100644 --- a/src/main/java/cofh/lib/inventory/ComparableItemStackNBT.java +++ b/src/main/java/cofh/lib/inventory/ComparableItemStackNBT.java @@ -19,10 +19,8 @@ public ComparableItemStackNBT(ItemStack stack) { super(stack); - if (stack != null) { - if (stack.stackTagCompound != null) { - tag = (NBTTagCompound) stack.stackTagCompound.copy(); - } + if (stack != null && stack.stackTagCompound != null) { + tag = (NBTTagCompound) stack.stackTagCompound.copy(); } } diff --git a/src/main/java/cofh/lib/render/RenderFluidOverlayItem.java b/src/main/java/cofh/lib/render/RenderFluidOverlayItem.java index 64e00de8..15fde5f2 100644 --- a/src/main/java/cofh/lib/render/RenderFluidOverlayItem.java +++ b/src/main/java/cofh/lib/render/RenderFluidOverlayItem.java @@ -55,10 +55,9 @@ public void renderItem(ItemRenderType type, ItemStack stack, Object... data) { if (item instanceof IFluidContainerItem) { IFluidContainerItem fluidItem = (IFluidContainerItem) item; fluid = fluidItem.getFluid(stack); - } else if (item instanceof IFluidOverlayItem) { - if (item.getRenderPasses(ItemHelper.getItemDamage(stack)) == 2) { - fluid = FluidContainerRegistry.getFluidForFilledItem(stack); - } + } else if (item instanceof IFluidOverlayItem + && item.getRenderPasses(ItemHelper.getItemDamage(stack)) == 2) { + fluid = FluidContainerRegistry.getFluidForFilledItem(stack); } doRenderItem(type, stack, item, fluid); } diff --git a/src/main/java/cofh/lib/transport/EnderRegistry.java b/src/main/java/cofh/lib/transport/EnderRegistry.java index 204a84dc..e535d17d 100644 --- a/src/main/java/cofh/lib/transport/EnderRegistry.java +++ b/src/main/java/cofh/lib/transport/EnderRegistry.java @@ -366,12 +366,11 @@ public void removeDestination(IEnderDestination theAttuned) { if (dest == null) { return; } - if (dest.dimension == theAttuned.dimension()) { - if (dest.x == theAttuned.x() && dest.y == theAttuned.y() && dest.z == theAttuned.z()) { - map.remove(freq); - usedTeleports.get(channel).set(freq, false); - linkConf.getCategory(channel).remove(String.valueOf(freq)); - } + if (dest.dimension == theAttuned.dimension() + && dest.x == theAttuned.x() && dest.y == theAttuned.y() && dest.z == theAttuned.z()) { + map.remove(freq); + usedTeleports.get(channel).set(freq, false); + linkConf.getCategory(channel).remove(String.valueOf(freq)); } } diff --git a/src/main/java/cofh/lib/util/UtilLiquidMover.java b/src/main/java/cofh/lib/util/UtilLiquidMover.java index 0835b653..218bbc17 100644 --- a/src/main/java/cofh/lib/util/UtilLiquidMover.java +++ b/src/main/java/cofh/lib/util/UtilLiquidMover.java @@ -138,15 +138,14 @@ public static boolean manuallyDrainTank(ITankContainerBucketable itcb, EntityPla filledBucket = null; } } - if (filledBucket != null) { - if (ItemHelper.disposePlayerItem(ci, filledBucket, player, true)) { - if (!player.worldObj.isRemote) { - player.openContainer.detectAndSendChanges(); - ((EntityPlayerMP) player).sendContainerAndContentsToPlayer(player.openContainer, player.openContainer.getInventory()); - } - itcb.drain(ForgeDirection.UNKNOWN, bucketLiquid, true); - return true; + if (filledBucket != null + && ItemHelper.disposePlayerItem(ci, filledBucket, player, true)) { + if (!player.worldObj.isRemote) { + player.openContainer.detectAndSendChanges(); + ((EntityPlayerMP) player).sendContainerAndContentsToPlayer(player.openContainer, player.openContainer.getInventory()); } + itcb.drain(ForgeDirection.UNKNOWN, bucketLiquid, true); + return true; } } } diff --git a/src/main/java/cofh/lib/util/helpers/ItemHelper.java b/src/main/java/cofh/lib/util/helpers/ItemHelper.java index 1acf66ea..61fcac5f 100644 --- a/src/main/java/cofh/lib/util/helpers/ItemHelper.java +++ b/src/main/java/cofh/lib/util/helpers/ItemHelper.java @@ -165,13 +165,11 @@ public static String getNameFromItemStack(ItemStack stack) { public static ItemStack damageItem(ItemStack stack, int amt, Random rand) { - if (stack != null && stack.isItemStackDamageable()) { - if (stack.attemptDamageItem(amt, rand)) { - if (--stack.stackSize <= 0) { - stack = null; - } else { - stack.setItemDamage(0); - } + if (stack != null && stack.isItemStackDamageable() && stack.attemptDamageItem(amt, rand)) { + if (--stack.stackSize <= 0) { + stack = null; + } else { + stack.setItemDamage(0); } } diff --git a/src/main/java/cofh/lib/world/feature/FeatureBase.java b/src/main/java/cofh/lib/world/feature/FeatureBase.java index 10f80751..d474eb55 100644 --- a/src/main/java/cofh/lib/world/feature/FeatureBase.java +++ b/src/main/java/cofh/lib/world/feature/FeatureBase.java @@ -105,10 +105,9 @@ public boolean generateFeature(Random random, int chunkX, int chunkZ, World worl if (!newGen && !regen) { return false; } - if (dimensionRestriction != GenRestriction.NONE) { - if (dimensionRestriction == GenRestriction.BLACKLIST == dimensions.contains(world.provider.dimensionId)) { - return false; - } + if (dimensionRestriction != GenRestriction.NONE + && dimensionRestriction == GenRestriction.BLACKLIST == dimensions.contains(world.provider.dimensionId)) { + return false; } if (rarity > 1 && random.nextInt(rarity) != 0) { return false; diff --git a/src/main/java/cofh/lib/world/feature/FeatureGenSurface.java b/src/main/java/cofh/lib/world/feature/FeatureGenSurface.java index 5288fda7..65de7100 100644 --- a/src/main/java/cofh/lib/world/feature/FeatureGenSurface.java +++ b/src/main/java/cofh/lib/world/feature/FeatureGenSurface.java @@ -44,11 +44,8 @@ public boolean generateFeature(Random random, int chunkX, int chunkZ, World worl int y = BlockHelper.getSurfaceBlockY(world, x, z); l: { Block block = world.getBlock(x, y, z); - if (!block.isAir(world, x, y, z)) { - - if (canGenerateInBlock(world, x, y, z, matList)) { - break l; - } + if (!block.isAir(world, x, y, z) && canGenerateInBlock(world, x, y, z, matList)) { + break l; } continue; } diff --git a/src/main/java/cofh/lib/world/feature/FeatureGenTopBlock.java b/src/main/java/cofh/lib/world/feature/FeatureGenTopBlock.java index 32018ce7..d4618c7f 100644 --- a/src/main/java/cofh/lib/world/feature/FeatureGenTopBlock.java +++ b/src/main/java/cofh/lib/world/feature/FeatureGenTopBlock.java @@ -44,11 +44,8 @@ public boolean generateFeature(Random random, int chunkX, int chunkZ, World worl int y = BlockHelper.getTopBlockY(world, x, z); l: { Block block = world.getBlock(x, y, z); - if (!block.isAir(world, x, y, z)) { - - if (canGenerateInBlock(world, x, y, z, matList)) { - break l; - } + if (!block.isAir(world, x, y, z) && canGenerateInBlock(world, x, y, z, matList)) { + break l; } continue; }