From fbccf4e08749ced61eee1fd46db5abb42960bb54 Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Thu, 26 Jan 2023 00:41:47 +0100 Subject: [PATCH] quick fix : Statement with empty body --- src/main/java/tconstruct/TConstruct.java | 4 +- .../tconstruct/armor/ArmorProxyClient.java | 4 +- .../java/tconstruct/blocks/BlockFalling.java | 4 +- .../library/tools/AbilityHelper.java | 6 +-- .../entity/item/EntityLandmineFirework.java | 6 +-- .../landmine/behavior/BehaviorFirework.java | 4 +- .../SpecialStackHandlerRocketFireball.java | 4 +- .../smeltery/model/PaneConnectedRender.java | 4 +- .../tconstruct/tools/entity/ArrowEntity.java | 6 +-- .../tconstruct/tools/entity/RotatingBase.java | 24 +++++++--- .../weaponry/client/RenderEventHandler.java | 4 +- .../tconstruct/world/entity/CartEntity.java | 44 +++++++++---------- 12 files changed, 63 insertions(+), 51 deletions(-) diff --git a/src/main/java/tconstruct/TConstruct.java b/src/main/java/tconstruct/TConstruct.java index e5919cbd..d5683605 100644 --- a/src/main/java/tconstruct/TConstruct.java +++ b/src/main/java/tconstruct/TConstruct.java @@ -203,9 +203,9 @@ public class TConstruct { @EventHandler public void init(FMLInitializationEvent event) { packetPipeline.initalise(); - if (event.getSide() == Side.CLIENT) { + //if (event.getSide() == Side.CLIENT) { // MinecraftForge.EVENT_BUS.register(new EventCloakRender()); - } + //} DimensionBlacklist.getBadBimensions(); GameRegistry.registerWorldGenerator(new SlimeIslandGen(TinkerWorld.slimePool, 2), 2); diff --git a/src/main/java/tconstruct/armor/ArmorProxyClient.java b/src/main/java/tconstruct/armor/ArmorProxyClient.java index 55f63a97..7a4fd434 100644 --- a/src/main/java/tconstruct/armor/ArmorProxyClient.java +++ b/src/main/java/tconstruct/armor/ArmorProxyClient.java @@ -533,7 +533,9 @@ public class ArmorProxyClient extends ArmorProxyCommon { private float interpolateRotation(float par1, float par2, float par3) { float f3; - for (f3 = par2 - par1; f3 < -180.0F; f3 += 360.0F) { + f3 = par2 - par1; + while (f3 < -180.0F) { + f3 += 360.0F; } while (f3 >= 180.0F) { diff --git a/src/main/java/tconstruct/blocks/BlockFalling.java b/src/main/java/tconstruct/blocks/BlockFalling.java index f8553885..98e24b28 100644 --- a/src/main/java/tconstruct/blocks/BlockFalling.java +++ b/src/main/java/tconstruct/blocks/BlockFalling.java @@ -50,7 +50,7 @@ public class BlockFalling extends Block { p_149830_2_ + b0, p_149830_3_ + b0, p_149830_4_ + b0)) { - if (!p_149830_1_.isRemote) { + //if (!p_149830_1_.isRemote) { // EntityFallingBlock entityfallingblock = new // EntityFallingBlock(p_149830_1_, // (double)((float)p_149830_2_ + 0.5F), @@ -60,7 +60,7 @@ public class BlockFalling extends Block { // p_149830_4_)); // this.func_149829_a(entityfallingblock); // p_149830_1_.spawnEntityInWorld(entityfallingblock); - } + //} } else { p_149830_1_.setBlockToAir(p_149830_2_, p_149830_3_, p_149830_4_); diff --git a/src/main/java/tconstruct/library/tools/AbilityHelper.java b/src/main/java/tconstruct/library/tools/AbilityHelper.java index 6ecc2fa6..1b27e860 100644 --- a/src/main/java/tconstruct/library/tools/AbilityHelper.java +++ b/src/main/java/tconstruct/library/tools/AbilityHelper.java @@ -387,9 +387,9 @@ public class AbilityHelper { tags.getCompoundTag("InfiTool").setInteger("Damage", damage + dam); int toolDamage = (damage * 100 / maxDamage) + 1; int stackDamage = stack.getItemDamage(); - if (toolDamage != stackDamage) { - // stack.setItemDamage((damage * 100 / maxDamage) + 1); - } + //if (toolDamage != stackDamage) { + // // stack.setItemDamage((damage * 100 / maxDamage) + 1); + //} } } } diff --git a/src/main/java/tconstruct/mechworks/entity/item/EntityLandmineFirework.java b/src/main/java/tconstruct/mechworks/entity/item/EntityLandmineFirework.java index 281729be..9f8daa72 100644 --- a/src/main/java/tconstruct/mechworks/entity/item/EntityLandmineFirework.java +++ b/src/main/java/tconstruct/mechworks/entity/item/EntityLandmineFirework.java @@ -110,9 +110,9 @@ public class EntityLandmineFirework extends Entity { float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); - for (this.rotationPitch = (float) (Math.atan2(this.motionY, f) * 180.0D / Math.PI); - this.rotationPitch - this.prevRotationPitch < -180.0F; - this.prevRotationPitch -= 360.0F) { + this.rotationPitch = (float) (Math.atan2(this.motionY, f) * 180.0D / Math.PI); + while (this.rotationPitch - this.prevRotationPitch < -180.0F) { + this.prevRotationPitch -= 360.0F; } while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { diff --git a/src/main/java/tconstruct/mechworks/landmine/behavior/BehaviorFirework.java b/src/main/java/tconstruct/mechworks/landmine/behavior/BehaviorFirework.java index c55b7a6b..17f2731a 100644 --- a/src/main/java/tconstruct/mechworks/landmine/behavior/BehaviorFirework.java +++ b/src/main/java/tconstruct/mechworks/landmine/behavior/BehaviorFirework.java @@ -35,11 +35,11 @@ public class BehaviorFirework extends Behavior { boolean shouldRun = true; if (triggerer instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) triggerer; - if (player.capabilities.isCreativeMode) { + //if (player.capabilities.isCreativeMode) { // Remove the bellow comment to make the player in creative // mode not get launched // shouldRun = false; - } + //} } if (shouldRun) { diff --git a/src/main/java/tconstruct/mechworks/landmine/behavior/stackCombo/SpecialStackHandlerRocketFireball.java b/src/main/java/tconstruct/mechworks/landmine/behavior/stackCombo/SpecialStackHandlerRocketFireball.java index 35a69e12..5ae36ee4 100644 --- a/src/main/java/tconstruct/mechworks/landmine/behavior/stackCombo/SpecialStackHandlerRocketFireball.java +++ b/src/main/java/tconstruct/mechworks/landmine/behavior/stackCombo/SpecialStackHandlerRocketFireball.java @@ -39,11 +39,11 @@ public class SpecialStackHandlerRocketFireball extends SpecialStackHandler { boolean shouldRun = true; if (triggerer instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) triggerer; - if (player.capabilities.isCreativeMode) { + //if (player.capabilities.isCreativeMode) { // Remove the bellow comment to make the player in // creative mode not get launched // shouldRun = false; - } + //} } if (shouldRun) { diff --git a/src/main/java/tconstruct/smeltery/model/PaneConnectedRender.java b/src/main/java/tconstruct/smeltery/model/PaneConnectedRender.java index f07c899b..f65358ad 100644 --- a/src/main/java/tconstruct/smeltery/model/PaneConnectedRender.java +++ b/src/main/java/tconstruct/smeltery/model/PaneConnectedRender.java @@ -36,10 +36,10 @@ public class PaneConnectedRender implements ISimpleBlockRenderingHandler { renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds(0.45D, 0D, 0D, 0.55D, 1D, 1D); renderer.renderStandardBlock(block, x, y, z); - } else { + } //else { // renderer.setRenderBounds(0.45D, 0D, 0.45D, 0.55D, 1D, 0.55D); // renderer.renderStandardBlock(block, x, y, z); - } + //} // renderer.setOverrideBlockTexture(sideTexture); diff --git a/src/main/java/tconstruct/tools/entity/ArrowEntity.java b/src/main/java/tconstruct/tools/entity/ArrowEntity.java index 7bfbafbc..aa5a43de 100644 --- a/src/main/java/tconstruct/tools/entity/ArrowEntity.java +++ b/src/main/java/tconstruct/tools/entity/ArrowEntity.java @@ -333,9 +333,9 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa speed = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); - for (this.rotationPitch = (float) (Math.atan2(this.motionY, speed) * 180.0D / Math.PI); - this.rotationPitch - this.prevRotationPitch < -180.0F; - this.prevRotationPitch -= 360.0F) { + this.rotationPitch = (float) (Math.atan2(this.motionY, speed) * 180.0D / Math.PI); + while (this.rotationPitch - this.prevRotationPitch < -180.0F) { + this.prevRotationPitch -= 360.0F; } while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { diff --git a/src/main/java/tconstruct/tools/entity/RotatingBase.java b/src/main/java/tconstruct/tools/entity/RotatingBase.java index 662e9e6b..a1031e18 100644 --- a/src/main/java/tconstruct/tools/entity/RotatingBase.java +++ b/src/main/java/tconstruct/tools/entity/RotatingBase.java @@ -219,12 +219,19 @@ public class RotatingBase extends Entity implements IEntityAdditionalSpawnData { posZ += motionZ; float f1 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); rotationYaw = (float) ((Math.atan2(motionX, motionZ) * 180D) / 3.1415927410125732D); - for (rotationPitch = (float) ((Math.atan2(motionY, f1) * 180D) / 3.1415927410125732D); - rotationPitch - prevRotationPitch < -180F; - prevRotationPitch -= 360F) {} - for (; rotationPitch - prevRotationPitch >= 180F; prevRotationPitch += 360F) {} - for (; rotationYaw - prevRotationYaw < -180F; prevRotationYaw -= 360F) {} - for (; rotationYaw - prevRotationYaw >= 180F; prevRotationYaw += 360F) {} + rotationPitch = (float) ((Math.atan2(motionY, f1) * 180D) / 3.1415927410125732D); + while (rotationPitch - prevRotationPitch < -180F) { + prevRotationPitch -= 360F; + } + while (rotationPitch - prevRotationPitch >= 180F) { + prevRotationPitch += 360F; + } + while (rotationYaw - prevRotationYaw < -180F) { + prevRotationYaw -= 360F; + } + while (rotationYaw - prevRotationYaw >= 180F) { + prevRotationYaw += 360F; + } rotationPitch = prevRotationPitch + (rotationPitch - prevRotationPitch) * 0.2F; rotationYaw = prevRotationYaw + (rotationYaw - prevRotationYaw) * 0.2F; float f2 = 0.99F; @@ -251,7 +258,10 @@ public class RotatingBase extends Entity implements IEntityAdditionalSpawnData { setPosition(posX, posY, posZ); if (!onGround) { prevBoomerangRotation = boomerangRotation; - for (boomerangRotation += 36F; boomerangRotation > 360F; boomerangRotation -= 360F) {} + boomerangRotation += 36F; + while (boomerangRotation > 360F) { + boomerangRotation -= 360F; + } } } diff --git a/src/main/java/tconstruct/weaponry/client/RenderEventHandler.java b/src/main/java/tconstruct/weaponry/client/RenderEventHandler.java index bb2a6fb0..e784e070 100644 --- a/src/main/java/tconstruct/weaponry/client/RenderEventHandler.java +++ b/src/main/java/tconstruct/weaponry/client/RenderEventHandler.java @@ -25,8 +25,8 @@ public class RenderEventHandler { @SubscribeEvent public void onRenderPlayer(RenderPlayerEvent.Pre event) { - if (event.entityPlayer.getCurrentEquippedItem() != null - && event.entityPlayer.getCurrentEquippedItem().getItem() == TinkerWeaponry.javelin) {} + //if (event.entityPlayer.getCurrentEquippedItem() != null && event.entityPlayer.getCurrentEquippedItem().getItem() == TinkerWeaponry.javelin) { + //} if (event.entityPlayer.getItemInUse() == null) return; diff --git a/src/main/java/tconstruct/world/entity/CartEntity.java b/src/main/java/tconstruct/world/entity/CartEntity.java index 6fa18e0f..b36f5a93 100644 --- a/src/main/java/tconstruct/world/entity/CartEntity.java +++ b/src/main/java/tconstruct/world/entity/CartEntity.java @@ -314,28 +314,28 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS MinecraftServer var1 = ((WorldServer) this.worldObj).func_73046_m(); var2 = this.getMaxInPortalTime(); - if (this.inPortal) { - if (var1.getAllowNether()) { - /* - * if (this.ridingEntity == null && this.timeInPortal++ >= - * var2) { this.timeInPortal = var2; this.timeUntilPortal = - * this.getPortalCooldown(); byte var3; - * - * if (this.worldObj.provider.dimensionId == -1) { var3 = 0; - * } else { var3 = -1; } - * - * this.travelToDimension(var3); } - * - * this.inPortal = false; - */ - } - } else { - /* - * if (this.timeInPortal > 0) { this.timeInPortal -= 4; } - * - * if (this.timeInPortal < 0) { this.timeInPortal = 0; } - */ - } + //if (this.inPortal) { + // if (var1.getAllowNether()) { + // /* + // * if (this.ridingEntity == null && this.timeInPortal++ >= + // * var2) { this.timeInPortal = var2; this.timeUntilPortal = + // * this.getPortalCooldown(); byte var3; + // * + // * if (this.worldObj.provider.dimensionId == -1) { var3 = 0; + // * } else { var3 = -1; } + // * + // * this.travelToDimension(var3); } + // * + // * this.inPortal = false; + // */ + // } + //} else { + // /* + // * if (this.timeInPortal > 0) { this.timeInPortal -= 4; } + // * + // * if (this.timeInPortal < 0) { this.timeInPortal = 0; } + // */ + //} if (this.timeUntilPortal > 0) { --this.timeUntilPortal;