diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2017-01-20 02:07:40 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2017-01-20 02:07:40 +1000 |
commit | a6bb1b33da251f4a2ec7a6d6facb4864e9905341 (patch) | |
tree | 84d47440794cadd5c64598355903b123e18e0662 /src/Java/gtPlusPlus/core/handler | |
parent | 142fe00070526484862f15f3a125400a22a2fe96 (diff) | |
download | GT5-Unofficial-a6bb1b33da251f4a2ec7a6d6facb4864e9905341.tar.gz GT5-Unofficial-a6bb1b33da251f4a2ec7a6d6facb4864e9905341.tar.bz2 GT5-Unofficial-a6bb1b33da251f4a2ec7a6d6facb4864e9905341.zip |
+ Added a power cost of 32eu/action for the Tree Farmer. (Will eventually get a config option).
% Moved the internal power buffer variable out of the cut method into the class.
% Massive project tidy up, lots of old unused code removed or tidied up.
$ Fixed lots of String comparisons that used == instead of .equals().
$ Fixed Double/Triple/Quad null checks in certain places.
$ Fixed returns that set values at the same time.
$ Swapped 3.14 and 1.57 to Math.PI and Math.PI/2.
$ Fixed possible cases where a NPE may be thrown, by calling logging outside of null checks.
+ Added PI to CORE.java, since it's a double and MC uses it as a float in each instance.
- Stripped 95% of the useless code out of Meta_GT_Proxy.java
Diffstat (limited to 'src/Java/gtPlusPlus/core/handler')
4 files changed, 45 insertions, 43 deletions
diff --git a/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java index f9abae6d32..a50524122b 100644 --- a/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java +++ b/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java @@ -28,7 +28,7 @@ public class LoginEventHandler { try { - if (localPlayerRef instanceof EntityPlayerMP && localPlayerRef != null){ + if (localPlayerRef instanceof EntityPlayerMP){ //Populates player cache if (!localPlayerRef.worldObj.isRemote){ diff --git a/src/Java/gtPlusPlus/core/handler/events/SneakManager.java b/src/Java/gtPlusPlus/core/handler/events/SneakManager.java index 9edc962a6b..f330fea861 100644 --- a/src/Java/gtPlusPlus/core/handler/events/SneakManager.java +++ b/src/Java/gtPlusPlus/core/handler/events/SneakManager.java @@ -4,7 +4,7 @@ import gtPlusPlus.core.util.Utils; import net.minecraft.client.Minecraft; public class SneakManager { - + //We make this a singleton for clientside data storage. public static SneakManager instance = new SneakManager(); protected static final Minecraft mc = Minecraft.getMinecraft(); @@ -12,72 +12,73 @@ public class SneakManager { public static boolean isSneaking = true; public static boolean optionDoubleTap = true; public static boolean wasSprintDisabled = false; - + private static State Sprinting = State.ON; private static State Crouching = State.OFF; - + public static boolean Sneaking(){ return Crouching.getState(); } - + public static boolean Sprinting(){ return Sprinting.getState(); } - + public static State getSneakingState(){ return Crouching; } - + public static State getSprintingDisabledState(){ return Sprinting; } - + public static void toggleSneaking(){ toggleState(Crouching); } - + public static void toggleSprinting(){ toggleState(Sprinting); } - + private static State toggleState(State state){ Utils.LOG_INFO("State Toggle"); - if (state == State.ON) - return state = State.OFF; - return state = State.ON; + if (state == State.ON) { + return State.OFF; + } + return State.ON; } - + public static State setCrouchingStateON(){ return Crouching = State.ON; } - + public static State setCrouchingStateOFF(){ return Crouching = State.OFF; } - + public static State setSprintingStateON(){ return Sprinting = State.ON; } - + public static State setSprintingStateOFF(){ return Sprinting = State.OFF; } - - public static enum State { - ON(true), - OFF(false); - - private boolean STATE; - private State (final boolean State) - { - this.STATE = State; - } - - public boolean getState() { - return STATE; - } - - } - + + public static enum State { + ON(true), + OFF(false); + + private boolean STATE; + private State (final boolean State) + { + this.STATE = State; + } + + public boolean getState() { + return STATE; + } + + } + } diff --git a/src/Java/gtPlusPlus/core/handler/render/CapeHandler.java b/src/Java/gtPlusPlus/core/handler/render/CapeHandler.java index 9f449e3044..f5e87ff512 100644 --- a/src/Java/gtPlusPlus/core/handler/render/CapeHandler.java +++ b/src/Java/gtPlusPlus/core/handler/render/CapeHandler.java @@ -80,8 +80,8 @@ public class CapeHandler extends RenderPlayer { float f6 = aPlayer.prevRenderYawOffset + (aPlayer.renderYawOffset - aPlayer.prevRenderYawOffset) * aPartialTicks; - double d3 = MathHelper.sin(f6 * 3.141593F / 180.0F); - double d4 = -MathHelper.cos(f6 * 3.141593F / 180.0F); + double d3 = MathHelper.sin(f6 * CORE.PI / 180.0F); + double d4 = -MathHelper.cos(f6 * CORE.PI / 180.0F); float f7 = (float) d1 * 10.0F; float f8 = (float) (d0 * d3 + d2 * d4) * 100.0F; float f9 = (float) (d0 * d4 - (d2 * d3)) * 100.0F; diff --git a/src/Java/gtPlusPlus/core/handler/render/FirepitModel.java b/src/Java/gtPlusPlus/core/handler/render/FirepitModel.java index d07f7338df..9bad3d2f4e 100644 --- a/src/Java/gtPlusPlus/core/handler/render/FirepitModel.java +++ b/src/Java/gtPlusPlus/core/handler/render/FirepitModel.java @@ -6,6 +6,7 @@ package gtPlusPlus.core.handler.render; +import gtPlusPlus.core.lib.CORE; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; @@ -40,14 +41,14 @@ public class FirepitModel extends ModelBase Side_B.setRotationPoint(-6F, 18F, 6F); Side_B.setTextureSize(16, 16); Side_B.mirror = true; - setRotation(Side_B, -0.3148822F, 1.570796F, 0F); + setRotation(Side_B, -0.3148822F, (CORE.PI/2), 0F); Side_C = new ModelRenderer(this, 0, 0); Side_C.addBox(0F, 0F, 0F, 12, 6, 1); Side_C.setRotationPoint(6F, 18F, 6F); Side_C.setTextureSize(16, 16); Side_C.mirror = true; - setRotation(Side_C, -0.3148822F, 3.141593F, 0F); + setRotation(Side_C, -0.3148822F, CORE.PI, 0F); //Side_C.mirror = false; Side_D = new ModelRenderer(this, 0, 0); @@ -62,14 +63,14 @@ public class FirepitModel extends ModelBase Log1.setRotationPoint(4F, 10F, -4F); Log1.setTextureSize(16, 16); Log1.mirror = true; - setRotation(Log1, 0F, 0F, 1.570796F); + setRotation(Log1, 0F, 0F, (CORE.PI/2)); Log2 = new ModelRenderer(this, -2, 10); Log2.addBox(0F, 0F, 0F, 14, 2, 2); Log2.setRotationPoint(-4F, 10F, -4F); Log2.setTextureSize(16, 16); Log2.mirror = true; - setRotation(Log2, 1.570796F, 0F, 1.570796F); + setRotation(Log2, (CORE.PI/2), 0F, (CORE.PI/2)); //Log2.mirror = false; Log3 = new ModelRenderer(this, 0, 10); @@ -77,14 +78,14 @@ public class FirepitModel extends ModelBase Log3.setRotationPoint(-4F, 10F, 4F); Log3.setTextureSize(16, 16); Log3.mirror = true; - setRotation(Log3, 3.141593F, 0F, 1.570796F); + setRotation(Log3, CORE.PI, 0F, (CORE.PI/2)); Log4 = new ModelRenderer(this, -2, 10); Log4.addBox(0F, 0F, 0F, 14, 2, 2); Log4.setRotationPoint(4F, 10F, 4F); Log4.setTextureSize(16, 16); Log4.mirror = true; - setRotation(Log4, 4.712389F, 0F, 1.570796F); + setRotation(Log4, 4.712389F, 0F, (CORE.PI/2)); //Log4.mirror = false; } @@ -103,7 +104,7 @@ public class FirepitModel extends ModelBase Log4.render(f5); } - private void setRotation(ModelRenderer model, float x, float y, float z) + private static void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; |