Search in sources :

Example 1 with GoggleAura

use of mods.railcraft.common.items.ItemGoggles.GoggleAura in project Railcraft by Railcraft.

the class AuraKeyHandler method tick.

@SubscribeEvent
public void tick(TickEvent.ClientTickEvent event) {
    if (Minecraft.getMinecraft().currentScreen instanceof GuiChat)
        return;
    EntityPlayer player = Minecraft.getMinecraft().thePlayer;
    for (Map.Entry<GoggleAura, KeyBinding> keyBinding : keyBindings.entrySet()) {
        if (keyBinding.getValue().isPressed()) {
            GoggleAura aura = keyBinding.getKey();
            if (isAuraEnabled(aura)) {
                activeAuras.remove(aura);
                ChatPlugin.sendLocalizedChat(player, "gui.railcraft.aura.disable", "§5" + aura + "§7");
            } else {
                activeAuras.add(aura);
                ChatPlugin.sendLocalizedChat(player, "gui.railcraft.aura.enable", "§5" + aura + "§7");
            }
        }
    }
}
Also used : KeyBinding(net.minecraft.client.settings.KeyBinding) EntityPlayer(net.minecraft.entity.player.EntityPlayer) GuiChat(net.minecraft.client.gui.GuiChat) GoggleAura(mods.railcraft.common.items.ItemGoggles.GoggleAura) EnumMap(java.util.EnumMap) Map(java.util.Map) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

EnumMap (java.util.EnumMap)1 Map (java.util.Map)1 GoggleAura (mods.railcraft.common.items.ItemGoggles.GoggleAura)1 GuiChat (net.minecraft.client.gui.GuiChat)1 KeyBinding (net.minecraft.client.settings.KeyBinding)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1