use of am2.guis.AuraCustomizationMenu in project ArsMagica2 by Mithion.
the class AMKeyBindings method onKeyInput.
@SubscribeEvent
public void onKeyInput(KeyInputEvent event) {
EntityPlayer clientPlayer = FMLClientHandler.instance().getClient().thePlayer;
if (Minecraft.getMinecraft().currentScreen != null) {
if (Minecraft.getMinecraft().currentScreen instanceof GuiInventory) {
if (ManaToggleKey.isPressed()) {
boolean curDisplayFlag = AMCore.config.displayManaInInventory();
AMCore.config.setDisplayManaInInventory(!curDisplayFlag);
}
}
return;
}
if (ShapeGroupKey.isPressed()) {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
ItemStack curItem = player.inventory.getStackInSlot(player.inventory.currentItem);
if (curItem == null || (curItem.getItem() != ItemsCommonProxy.spell && curItem.getItem() != ItemsCommonProxy.spellBook && curItem.getItem() != ItemsCommonProxy.arcaneSpellbook)) {
return;
}
int shapeGroup;
if (curItem.getItem() == ItemsCommonProxy.spell) {
shapeGroup = SpellUtils.instance.cycleShapeGroup(curItem);
} else {
ItemStack spellStack = ((ItemSpellBook) curItem.getItem()).GetActiveItemStack(curItem);
if (spellStack == null) {
return;
}
shapeGroup = SpellUtils.instance.cycleShapeGroup(spellStack);
((ItemSpellBook) curItem.getItem()).replaceAciveItemStack(curItem, spellStack);
}
AMNetHandler.INSTANCE.sendShapeGroupChangePacket(shapeGroup, clientPlayer.getEntityId());
} else if (this.SpellBookNextSpellKey.isPressed()) {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
ItemStack curItem = player.inventory.getStackInSlot(player.inventory.currentItem);
if (curItem == null) {
return;
}
if (curItem.getItem() == ItemsCommonProxy.spellBook || curItem.getItem() == ItemsCommonProxy.arcaneSpellbook) {
//send packet to server
AMNetHandler.INSTANCE.sendSpellbookSlotChange(player, player.inventory.currentItem, ItemSpellBook.ID_NEXT_SPELL);
}
} else if (this.SpellBookPrevSpellKey.isPressed()) {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
ItemStack curItem = player.inventory.getStackInSlot(player.inventory.currentItem);
if (curItem == null) {
return;
}
if (curItem.getItem() == ItemsCommonProxy.spellBook || curItem.getItem() == ItemsCommonProxy.arcaneSpellbook) {
//send packet to server
AMNetHandler.INSTANCE.sendSpellbookSlotChange(player, player.inventory.currentItem, ItemSpellBook.ID_PREV_SPELL);
}
} else if (AuraCustomizationKey.isPressed()) {
if (AMCore.proxy.playerTracker.hasAA(clientPlayer)) {
Minecraft.getMinecraft().displayGuiScreen(new AuraCustomizationMenu());
}
} else if (AffinityActivationKey.isPressed()) {
if (AffinityData.For(clientPlayer).isAbilityReady()) {
//send packet to the server to process the ability
AMNetHandler.INSTANCE.sendAffinityActivate();
//activate the ability on the client
AffinityData.For(clientPlayer).onAffinityAbility();
}
}
}
Aggregations