From fc2975b4d342973bc8e82bff018f83729e7a8154 Mon Sep 17 00:00:00 2001 From: TheTemporatlist Date: Mon, 10 Nov 2014 18:47:15 -0500 Subject: [PATCH] Formatting fixes --- .../java/tconstruct/client/ArmorControls.java | 131 ++++++++---------- 1 file changed, 59 insertions(+), 72 deletions(-) diff --git a/src/main/java/tconstruct/client/ArmorControls.java b/src/main/java/tconstruct/client/ArmorControls.java index d567d496dee..25ea18a6bf9 100644 --- a/src/main/java/tconstruct/client/ArmorControls.java +++ b/src/main/java/tconstruct/client/ArmorControls.java @@ -24,30 +24,30 @@ import tconstruct.util.network.GogglePacket; public class ArmorControls { - public static final String keybindCategory = "tconstruct.keybindings"; - public static KeyBinding armorKey = new KeyBinding("key.tarmor", 24, keybindCategory); - public static KeyBinding toggleGoggles = new KeyBinding("key.tgoggles", 34, keybindCategory); - public static KeyBinding beltSwap = new KeyBinding("key.tbelt", 48, keybindCategory); - public static KeyBinding zoomKey = new KeyBinding("key.tzoom", 44, keybindCategory); //TODO: Make this hold, not toggle - static KeyBinding jumpKey; - static KeyBinding invKey; - static Minecraft mc; - - boolean jumping; - int midairJumps = 0; - boolean climbing = false; - boolean onGround = false; - public static boolean zoom = false; - boolean activeGoggles = false; //TODO: Set this on server login - - int currentTab = 1; - - // boolean onStilts = false; + public static final String keybindCategory = "tconstruct.keybindings"; + public static KeyBinding armorKey = new KeyBinding("key.tarmor", 24, keybindCategory); + public static KeyBinding toggleGoggles = new KeyBinding("key.tgoggles", 34, keybindCategory); + public static KeyBinding beltSwap = new KeyBinding("key.tbelt", 48, keybindCategory); + public static KeyBinding zoomKey = new KeyBinding("key.tzoom", 44, + keybindCategory); //TODO: Make this hold, not toggle + static KeyBinding jumpKey; + static KeyBinding invKey; + static Minecraft mc; + + boolean jumping; + int midairJumps = 0; + boolean climbing = false; + boolean onGround = false; + public static boolean zoom = false; + boolean activeGoggles = false; //TODO: Set this on server login + + int currentTab = 1; + + // boolean onStilts = false; private final KeyBinding[] keys; - public ArmorControls() - { + public ArmorControls() { getVanillaKeyBindings(); this.keys = new KeyBinding[] { ArmorControls.armorKey, @@ -57,7 +57,7 @@ public ArmorControls() null, null }; - } + } public void registerKeys() { // Register bindings @@ -70,13 +70,12 @@ public void registerKeys() { this.keys[5] = ArmorControls.invKey; } - private static KeyBinding[] getVanillaKeyBindings () - { - mc = Minecraft.getMinecraft(); - jumpKey = mc.gameSettings.keyBindJump; - invKey = mc.gameSettings.keyBindInventory; - return new KeyBinding[] { jumpKey, invKey }; - } + private static KeyBinding[] getVanillaKeyBindings() { + mc = Minecraft.getMinecraft(); + jumpKey = mc.gameSettings.keyBindJump; + invKey = mc.gameSettings.keyBindInventory; + return new KeyBinding[] { jumpKey, invKey }; + } @SubscribeEvent public void mouseEvent(InputEvent.MouseInputEvent event) { @@ -171,52 +170,40 @@ private void keyPressed(KeyBinding key) { } } - public void landOnGround() { + public void resetControls() { midairJumps = 0; jumping = false; + climbing = false; + onGround = false; + } + + void resetFallDamage() { + AbstractPacket packet = new DoubleJumpPacket(); + updateServer(packet); } - public void resetControls () - { - midairJumps = 0; - jumping = false; - climbing = false; - onGround = false; - } - - void resetFallDamage () - { - AbstractPacket packet = new DoubleJumpPacket(); - updateServer(packet); - } - - public static void openArmorGui () - { - AbstractPacket packet = new AccessoryInventoryPacket(ArmorProxyCommon.armorGuiID); - updateServer(packet); - } - - public static void openKnapsackGui () - { - AbstractPacket packet = new AccessoryInventoryPacket(ArmorProxyCommon.knapsackGuiID); - updateServer(packet); - } - - private void toggleGoggles () - { - AbstractPacket packet = new GogglePacket(activeGoggles); - updateServer(packet); - } - - private void toggleBelt () - { - AbstractPacket packet = new BeltPacket(); - updateServer(packet); - } - - static void updateServer (AbstractPacket abstractPacket) - { - TConstruct.packetPipeline.sendToServer(abstractPacket); - } + public static void openArmorGui() { + AbstractPacket packet = new AccessoryInventoryPacket(ArmorProxyCommon.armorGuiID); + updateServer(packet); + } + + public static void openKnapsackGui() { + AbstractPacket packet = new AccessoryInventoryPacket(ArmorProxyCommon.knapsackGuiID); + updateServer(packet); + } + + private void toggleGoggles() { + AbstractPacket packet = new GogglePacket(activeGoggles); + updateServer(packet); + } + + private void toggleBelt() { + AbstractPacket packet = new BeltPacket(); + updateServer(packet); + } + + static void updateServer(AbstractPacket abstractPacket) { + TConstruct.packetPipeline.sendToServer(abstractPacket); + } }