Search in sources :

Example 1 with GuiPack

use of tonius.simplyjetpacks.gui.GuiPack in project SimplyJetpacks by Tonius.

the class GuiHandler method getClientGuiElement.

@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
    switch(ID) {
        case PACK:
            ItemStack chestplate = player.getCurrentArmor(2);
            if (chestplate != null && chestplate.getItem() instanceof ItemPack) {
                ItemPack packItem = (ItemPack) chestplate.getItem();
                PackBase pack = packItem.getPack(chestplate);
                if (pack != null) {
                    return new GuiPack(new ContainerPack(chestplate, packItem, pack));
                }
            }
    }
    return null;
}
Also used : ContainerPack(tonius.simplyjetpacks.gui.ContainerPack) PackBase(tonius.simplyjetpacks.item.meta.PackBase) GuiPack(tonius.simplyjetpacks.gui.GuiPack) ItemPack(tonius.simplyjetpacks.item.ItemPack) ItemStack(net.minecraft.item.ItemStack)

Aggregations

ItemStack (net.minecraft.item.ItemStack)1 ContainerPack (tonius.simplyjetpacks.gui.ContainerPack)1 GuiPack (tonius.simplyjetpacks.gui.GuiPack)1 ItemPack (tonius.simplyjetpacks.item.ItemPack)1 PackBase (tonius.simplyjetpacks.item.meta.PackBase)1