Skip to content

Commit

Permalink
Fixes Issue #945
Browse files Browse the repository at this point in the history
  • Loading branch information
Qowyn committed Sep 5, 2014
1 parent 2342d4a commit efac2f7
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 25 deletions.
6 changes: 0 additions & 6 deletions src/main/java/tconstruct/TConstruct.java
Expand Up @@ -29,7 +29,6 @@
import tconstruct.armor.TinkerArmor;
import tconstruct.armor.player.TPlayerHandler;
import tconstruct.armor.player.TPlayerStats;
import tconstruct.client.TControls;
import tconstruct.library.TConstructCreativeTab;
import tconstruct.common.TProxyCommon;
import tconstruct.library.TConstructRegistry;
Expand Down Expand Up @@ -154,11 +153,6 @@ public void preInit (FMLPreInitializationEvent event)
MinecraftForge.EVENT_BUS.register(playerTracker);
NetworkRegistry.INSTANCE.registerGuiHandler(TConstruct.instance, proxy);

if (event.getSide() == Side.CLIENT)
{
FMLCommonHandler.instance().bus().register(new TControls());
}

pulsar.preInit(event);

if (PHConstruct.addToVillages)
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/tconstruct/armor/ArmorAbilitiesClient.java
Expand Up @@ -5,7 +5,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import tconstruct.armor.player.TPlayerStats;
import tconstruct.client.TControls;
import tconstruct.client.ArmorControls;
import tconstruct.library.modifier.IModifyable;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
Expand All @@ -14,7 +14,7 @@
public class ArmorAbilitiesClient
{
Minecraft mc;
TControls controlInstance;
ArmorControls controlInstance;

ItemStack prevFeet;
double prevMotionY;
Expand All @@ -25,7 +25,7 @@ public class ArmorAbilitiesClient
float prevMouseSensitivity;
boolean sprint;

public ArmorAbilitiesClient(Minecraft mc, TControls p)
public ArmorAbilitiesClient(Minecraft mc, ArmorControls p)
{
this.mc = mc;
this.controlInstance = p;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/tconstruct/armor/ArmorProxyClient.java
Expand Up @@ -39,7 +39,7 @@
import tconstruct.armor.model.WingModel;
import tconstruct.armor.player.ArmorExtended;
import tconstruct.armor.player.KnapsackInventory;
import tconstruct.client.TControls;
import tconstruct.client.ArmorControls;
import tconstruct.client.TKeyHandler;
import tconstruct.client.tabs.InventoryTabArmorExtended;
import tconstruct.client.tabs.InventoryTabKnapsack;
Expand Down Expand Up @@ -148,12 +148,12 @@ public void registerTickHandler ()
}

/* Keybindings */
public static TControls controlInstance;
public static ArmorControls controlInstance;

@Override
public void registerKeys ()
{
controlInstance = new TControls();
controlInstance = new ArmorControls();
uploadKeyBindingsToGame(Minecraft.getMinecraft().gameSettings, controlInstance);

TabRegistry.registerTab(new InventoryTabVanilla());
Expand Down Expand Up @@ -191,7 +191,7 @@ public void uploadKeyBindingsToGame (GameSettings settings, TKeyHandler keyhandl
@SubscribeEvent
public void goggleZoom (FOVUpdateEvent event)
{
if (TControls.zoom)
if (ArmorControls.zoom)
{
ItemStack helmet = event.entity.getCurrentArmor(3);
if (helmet != null && helmet.getItem() instanceof TravelGear)
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/armor/ArmorTickHandler.java
@@ -1,7 +1,7 @@
package tconstruct.armor;

import net.minecraft.client.Minecraft;
import tconstruct.client.TControls;
import tconstruct.client.ArmorControls;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
import cpw.mods.fml.relauncher.Side;
Expand All @@ -11,7 +11,7 @@ public class ArmorTickHandler
{
Minecraft mc = Minecraft.getMinecraft();

TControls controlInstance = ((ArmorProxyClient)TinkerArmor.proxy).controlInstance;
ArmorControls controlInstance = ((ArmorProxyClient)TinkerArmor.proxy).controlInstance;

@SideOnly(Side.CLIENT)
@SubscribeEvent
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/tconstruct/armor/TinkerArmor.java
Expand Up @@ -27,6 +27,7 @@
import tconstruct.armor.items.TravelGlove;
import tconstruct.armor.items.TravelWings;
import tconstruct.blocks.logic.DryingRackLogic;
import tconstruct.client.ArmorControls;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.accessory.AccessoryCore;
import tconstruct.library.armor.ArmorPart;
Expand All @@ -51,6 +52,7 @@
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
import cpw.mods.fml.relauncher.Side;

@ObjectHolder(TConstruct.modID)
@Pulse(id = "Tinkers' Armory", description = "Modifyable armors, such as the traveller's gear.")
Expand Down Expand Up @@ -94,6 +96,11 @@ public void preInit (FMLPreInitializationEvent event)
{
MinecraftForge.EVENT_BUS.register(new TinkerArmorEvents());
FMLCommonHandler.instance().bus().register(new ArmorAbilities());

if (event.getSide() == Side.CLIENT)
{
FMLCommonHandler.instance().bus().register(new ArmorControls());
}

TinkerArmor.dryingRack = new DryingRack().setBlockName("Armor.DryingRack");
GameRegistry.registerBlock(TinkerArmor.dryingRack, "Armor.DryingRack");
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/armor/items/TravelBelt.java
Expand Up @@ -11,7 +11,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import tconstruct.armor.ArmorProxyClient;
import tconstruct.client.TControls;
import tconstruct.client.ArmorControls;
import tconstruct.library.accessory.AccessoryCore;
import tconstruct.library.accessory.IAccessoryModel;
import cpw.mods.fml.relauncher.Side;
Expand Down Expand Up @@ -60,6 +60,6 @@ public void addInformation (ItemStack stack, EntityPlayer player, List list, boo
return;

list.add("\u00a76Ability: Swap Hotbar");
list.add("\u00a76Control: "+GameSettings.getKeyDisplayString(TControls.beltSwap.getKeyCode()));
list.add("\u00a76Control: "+GameSettings.getKeyDisplayString(ArmorControls.beltSwap.getKeyCode()));
}
}
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/armor/items/TravelGear.java
Expand Up @@ -175,8 +175,8 @@ public void addInformation (ItemStack stack, EntityPlayer player, List list, boo
switch (armorPart)
{
case Head:
list.add("\u00a76Ability: Zoom with " + GameSettings.getKeyDisplayString(tconstruct.client.TControls.zoomKey.getKeyCode()));
list.add("\u00a76Toggle Abilities: " + GameSettings.getKeyDisplayString(tconstruct.client.TControls.toggleGoggles.getKeyCode()));
list.add("\u00a76Ability: Zoom with " + GameSettings.getKeyDisplayString(tconstruct.client.ArmorControls.zoomKey.getKeyCode()));
list.add("\u00a76Toggle Abilities: " + GameSettings.getKeyDisplayString(tconstruct.client.ArmorControls.toggleGoggles.getKeyCode()));
break;
case Chest:
list.add("\u00a76Ability: Swift Swim");
Expand Down
Expand Up @@ -21,7 +21,7 @@
import tconstruct.util.network.GogglePacket;
import cpw.mods.fml.common.gameevent.TickEvent.Type;

public class TControls extends TKeyHandler
public class ArmorControls extends TKeyHandler
{
public static final String keybindCategory = "tconstruct.keybindings";
public static KeyBinding armorKey = new KeyBinding("key.tarmor", 24, keybindCategory);
Expand All @@ -43,7 +43,7 @@ public class TControls extends TKeyHandler

// boolean onStilts = false;

public TControls()
public ArmorControls()
{
super(new KeyBinding[] { armorKey, toggleGoggles, beltSwap, zoomKey }, new boolean[] { false, false, false, false }, getVanillaKeyBindings(), new boolean[] { false, false });
/*ClientRegistry.registerKeyBinding(armorKey);
Expand Down
Expand Up @@ -2,7 +2,7 @@

import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import tconstruct.client.TControls;
import tconstruct.client.ArmorControls;

public class InventoryTabArmorExtended extends AbstractTab
{
Expand All @@ -14,7 +14,7 @@ public InventoryTabArmorExtended()
@Override
public void onTabClicked ()
{
TControls.openArmorGui();
ArmorControls.openArmorGui();
}

@Override
Expand Down
Expand Up @@ -3,7 +3,7 @@
import net.minecraft.item.ItemStack;
import tconstruct.armor.ArmorProxyClient;
import tconstruct.armor.TinkerArmor;
import tconstruct.client.TControls;
import tconstruct.client.ArmorControls;

public class InventoryTabKnapsack extends AbstractTab
{
Expand All @@ -15,7 +15,7 @@ public InventoryTabKnapsack()
@Override
public void onTabClicked ()
{
TControls.openKnapsackGui();
ArmorControls.openKnapsackGui();
}

@Override
Expand Down

0 comments on commit efac2f7

Please sign in to comment.