Skip to content

Commit

Permalink
Formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTemportalist committed Nov 10, 2014
1 parent 8a0092e commit fc2975b
Showing 1 changed file with 59 additions and 72 deletions.
131 changes: 59 additions & 72 deletions src/main/java/tconstruct/client/ArmorControls.java
Expand Up @@ -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,
Expand All @@ -57,7 +57,7 @@ public ArmorControls()
null, null
};

}
}

public void registerKeys() {
// Register bindings
Expand All @@ -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) {
Expand Down Expand Up @@ -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);
}

}

0 comments on commit fc2975b

Please sign in to comment.