// Path: src/sct/hexxitgear/control/HGKeyHandler.java
// @SideOnly(Side.CLIENT)
// public class HGKeyHandler extends KeyBindingRegistry.KeyHandler {
// 
//     public static KeyBinding activateHexxitArmor = new KeyBinding("Activate Hexxit Gear Armor", Keyboard.KEY_X);
//     public static KeyBinding[] keybindArray = new KeyBinding[]{activateHexxitArmor};
//     public static boolean[] repeats = new boolean[keybindArray.length];
// 
//     public HGKeyHandler() {
//         super(keybindArray, repeats);
//     }
// 
//     @Override
//     public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) {
//         EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
// 
//         if (player == null || tickEnd)
//             return;
// 
//         if (kb.equals(activateHexxitArmor)) {
//             if (ArmorSet.getPlayerArmorSet(player.username) != null) {
//                 Object[] data = new Object[] { player.username };
//                 PacketDispatcher.sendPacketToServer(PacketWrapper.createPacket(HexxitGear.modNetworkChannel, Packets.armorAbility, data));
//                 //ArmorSet.readArmorPacket(player.username);
//             }
//         }
//     }
// 
//     @Override
//     public void keyUp(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd) {
// 
//     }
// 
//     @Override
//     public EnumSet<TickType> ticks() {
//         return EnumSet.of(TickType.CLIENT);
//     }
// 
//     @Override
//     public String getLabel() {
//         return "hexxitGearKeybinds";
//     }
// }
// 
// Path: src/sct/hexxitgear/tick/PlayerTickHandler.java
// public class PlayerTickHandler implements ITickHandler {
// 
//     private int tickCounter = 0;
// 
//     @Override
//     public void tickStart(EnumSet<TickType> type, Object... tickData) {
//         if (type.equals(EnumSet.of(TickType.PLAYER))) {
//             for (Object tick : tickData) {
//                 if (tick instanceof EntityPlayer) {
//                     EntityPlayer player = (EntityPlayer) tick;
//                     if (tickCounter > 20) {
//                         ArmorSet.getMatchingSet(player);
//                         tickCounter = 0;
//                     }
//                     tickCounter++;
// 
//                     if (ArmorSet.getPlayerArmorSet(player.username) != null) {
//                         ArmorSet armorSet = ArmorSet.getPlayerArmorSet(player.username);
//                         armorSet.applyBuffs(player);
//                     }
// 
//                     // We run this outside of the check for an armorset just incase a player takes off armor mid ability
//                     AbilityHandler bh = AbilityHandler.getPlayerAbilityHandler(player.username);
//                     if (bh != null) {
//                         bh.onTick(player);
//                     }
//                 }
//             }
//         }
//     }
// 
//     @Override
//     public void tickEnd(EnumSet<TickType> type, Object... tickData) {
//     }
// 
//     @Override
//     public EnumSet<TickType> ticks() {
//         return EnumSet.of(TickType.PLAYER);
//     }
// 
//     @Override
//     public String getLabel() {
//         return "HGPlayerTicks";
//     }
// }


import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.KeyBindingRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.entity.player.EntityPlayer;
import sct.hexxitgear.control.HGKeyHandler;
import sct.hexxitgear.tick.PlayerTickHandler;
/*
 * HexxitGear
 * Copyright (C) 2013  Ryan Cohen
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package sct.hexxitgear;


public class ClientProxy extends CommonProxy {

    @Override
    public int addArmor(String armorName) {
        return RenderingRegistry.addNewArmourRendererPrefix(armorName);
    }

    @Override
    public EntityPlayer findPlayer(String playerName) {
        for (Object a : FMLClientHandler.instance().getClient().theWorld.playerEntities) {
            EntityPlayer player = (EntityPlayer) a;
            if (player.username.toLowerCase().equals(playerName.toLowerCase())) {
                return player;
            }
        }
        return null;
    }

    @Override
    public void registerHandlers() {
        super.registerHandlers();
        TickRegistry.registerTickHandler(new PlayerTickHandler(), Side.CLIENT);
// Path: src/sct/hexxitgear/control/HGKeyHandler.java
// @SideOnly(Side.CLIENT)
// public class HGKeyHandler extends KeyBindingRegistry.KeyHandler {
// 
//     public static KeyBinding activateHexxitArmor = new KeyBinding("Activate Hexxit Gear Armor", Keyboard.KEY_X);
//     public static KeyBinding[] keybindArray = new KeyBinding[]{activateHexxitArmor};
//     public static boolean[] repeats = new boolean[keybindArray.length];
// 
//     public HGKeyHandler() {
//         super(keybindArray, repeats);
//     }
// 
//     @Override
//     public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) {
//         EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
// 
//         if (player == null || tickEnd)
//             return;
// 
//         if (kb.equals(activateHexxitArmor)) {
//             if (ArmorSet.getPlayerArmorSet(player.username) != null) {
//                 Object[] data = new Object[] { player.username };
//                 PacketDispatcher.sendPacketToServer(PacketWrapper.createPacket(HexxitGear.modNetworkChannel, Packets.armorAbility, data));
//                 //ArmorSet.readArmorPacket(player.username);
//             }
//         }
//     }
// 
//     @Override
//     public void keyUp(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd) {
// 
//     }
// 
//     @Override
//     public EnumSet<TickType> ticks() {
//         return EnumSet.of(TickType.CLIENT);
//     }
// 
//     @Override
//     public String getLabel() {
//         return "hexxitGearKeybinds";
//     }
// }
// 
// Path: src/sct/hexxitgear/tick/PlayerTickHandler.java
// public class PlayerTickHandler implements ITickHandler {
// 
//     private int tickCounter = 0;
// 
//     @Override
//     public void tickStart(EnumSet<TickType> type, Object... tickData) {
//         if (type.equals(EnumSet.of(TickType.PLAYER))) {
//             for (Object tick : tickData) {
//                 if (tick instanceof EntityPlayer) {
//                     EntityPlayer player = (EntityPlayer) tick;
//                     if (tickCounter > 20) {
//                         ArmorSet.getMatchingSet(player);
//                         tickCounter = 0;
//                     }
//                     tickCounter++;
// 
//                     if (ArmorSet.getPlayerArmorSet(player.username) != null) {
//                         ArmorSet armorSet = ArmorSet.getPlayerArmorSet(player.username);
//                         armorSet.applyBuffs(player);
//                     }
// 
//                     // We run this outside of the check for an armorset just incase a player takes off armor mid ability
//                     AbilityHandler bh = AbilityHandler.getPlayerAbilityHandler(player.username);
//                     if (bh != null) {
//                         bh.onTick(player);
//                     }
//                 }
//             }
//         }
//     }
// 
//     @Override
//     public void tickEnd(EnumSet<TickType> type, Object... tickData) {
//     }
// 
//     @Override
//     public EnumSet<TickType> ticks() {
//         return EnumSet.of(TickType.PLAYER);
//     }
// 
//     @Override
//     public String getLabel() {
//         return "HGPlayerTicks";
//     }
// }


// Path: src/sct/hexxitgear/ClientProxy.java
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.KeyBindingRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.entity.player.EntityPlayer;
import sct.hexxitgear.control.HGKeyHandler;
import sct.hexxitgear.tick.PlayerTickHandler;

/*
 * HexxitGear
 * Copyright (C) 2013  Ryan Cohen
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package sct.hexxitgear;


public class ClientProxy extends CommonProxy {

    @Override
    public int addArmor(String armorName) {
        return RenderingRegistry.addNewArmourRendererPrefix(armorName);
    }

    @Override
    public EntityPlayer findPlayer(String playerName) {
        for (Object a : FMLClientHandler.instance().getClient().theWorld.playerEntities) {
            EntityPlayer player = (EntityPlayer) a;
            if (player.username.toLowerCase().equals(playerName.toLowerCase())) {
                return player;
            }
        }
        return null;
    }

    @Override
    public void registerHandlers() {
        super.registerHandlers();
        TickRegistry.registerTickHandler(new PlayerTickHandler(), Side.CLIENT);
        KeyBindingRegistry.registerKeyBinding(new HGKeyHandler());