Search in sources :

Example 1 with ContainerPack

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

the class GuiHandler method getServerGuiElement.

@Override
public Object getServerGuiElement(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 ContainerPack(chestplate, packItem, pack);
                }
            }
    }
    return null;
}
Also used : ContainerPack(tonius.simplyjetpacks.gui.ContainerPack) PackBase(tonius.simplyjetpacks.item.meta.PackBase) ItemPack(tonius.simplyjetpacks.item.ItemPack) ItemStack(net.minecraft.item.ItemStack)

Example 2 with ContainerPack

use of tonius.simplyjetpacks.gui.ContainerPack 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)2 ContainerPack (tonius.simplyjetpacks.gui.ContainerPack)2 ItemPack (tonius.simplyjetpacks.item.ItemPack)2 PackBase (tonius.simplyjetpacks.item.meta.PackBase)2 GuiPack (tonius.simplyjetpacks.gui.GuiPack)1