Search in sources :

Example 1 with PacketBackpackOpen

use of net.mcft.copy.betterstorage.network.packet.PacketBackpackOpen in project BetterStorage by copygirl.

the class KeyBindingHandler method onKey.

@SubscribeEvent
public void onKey(KeyInputEvent event) {
    Minecraft mc = Minecraft.getMinecraft();
    EntityPlayer player = mc.thePlayer;
    if (!mc.inGameHasFocus || (player == null))
        return;
    if (backpackOpen.isPressed() && (ItemBackpack.getBackpack(player) != null) && BetterStorage.globalConfig.getBoolean(GlobalConfig.enableBackpackOpen))
        BetterStorage.networkChannel.sendToServer(new PacketBackpackOpen());
    else if (drinkingHelmet.isPressed() && (player.getEquipmentInSlot(EquipmentSlot.HEAD) != null))
        BetterStorage.networkChannel.sendToServer(new PacketDrinkingHelmetUse());
}
Also used : PacketBackpackOpen(net.mcft.copy.betterstorage.network.packet.PacketBackpackOpen) EntityPlayer(net.minecraft.entity.player.EntityPlayer) Minecraft(net.minecraft.client.Minecraft) PacketDrinkingHelmetUse(net.mcft.copy.betterstorage.network.packet.PacketDrinkingHelmetUse) SubscribeEvent(cpw.mods.fml.common.eventhandler.SubscribeEvent)

Aggregations

SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)1 PacketBackpackOpen (net.mcft.copy.betterstorage.network.packet.PacketBackpackOpen)1 PacketDrinkingHelmetUse (net.mcft.copy.betterstorage.network.packet.PacketDrinkingHelmetUse)1 Minecraft (net.minecraft.client.Minecraft)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1