Search in sources :

Example 1 with GuiManual

use of com.miningmark48.pearcelmod.gui.manual.GuiManual in project Pearcel-Mod by MiningMark48.

the class KeyHandler method onEvent.

@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true)
public void onEvent(TickEvent.PlayerTickEvent event) {
    if (event.side == Side.SERVER) {
        return;
    }
    if (event.phase == TickEvent.Phase.START) {
        Minecraft mc = Minecraft.getMinecraft();
        EntityPlayer player = event.player;
        World world = player.getEntityWorld();
        int x = (int) event.player.posX;
        int y = (int) event.player.posY;
        int z = (int) event.player.posZ;
        //PCP GUI
        if (item_pcp.isPressed()) {
            if (player.inventory.hasItemStack(new ItemStack(ModItems.pcp))) {
                player.sendMessage(new TextComponentString("This is a WIP, Coming Soon™!"));
            //player.openGui(PearcelMod.instance, GUIs.gui_id_pcp, world, x, y, z);
            }
        }
        //PEPC GUI
        if (item_pepc.isPressed()) {
            if (player.inventory.hasItemStack(new ItemStack(ModItems.pepc))) {
                player.sendMessage(new TextComponentString("This is a WIP, Coming Soon™!"));
            //player.displayGUIChest(player.getInventoryEnderChest());
            }
        }
        //Manual Gui
        if (gui_manual.isPressed()) {
            if (player.inventory.hasItemStack(new ItemStack(ModItems.pearcel_manual))) {
                Minecraft.getMinecraft().displayGuiScreen(new GuiManual(0));
            }
        }
    }
}
Also used : GuiManual(com.miningmark48.pearcelmod.gui.manual.GuiManual) EntityPlayer(net.minecraft.entity.player.EntityPlayer) World(net.minecraft.world.World) ItemStack(net.minecraft.item.ItemStack) Minecraft(net.minecraft.client.Minecraft) TextComponentString(net.minecraft.util.text.TextComponentString) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

GuiManual (com.miningmark48.pearcelmod.gui.manual.GuiManual)1 Minecraft (net.minecraft.client.Minecraft)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 ItemStack (net.minecraft.item.ItemStack)1 TextComponentString (net.minecraft.util.text.TextComponentString)1 World (net.minecraft.world.World)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1