Search in sources :

Example 21 with IconMenuItem

use of de.Keyle.MyPet.api.gui.IconMenuItem in project MyPet by xXKeyleXx.

the class IconMenuInventory method update.

@Override
public void update(IconMenu menu) {
    for (int slot = 0; slot < size; slot++) {
        IconMenuItem menuItem = menu.getOption(slot);
        if (menuItem != null) {
            ItemStack item = createItemStack(menuItem);
            minecraftInventory.setItem(slot, item);
        } else {
            minecraftInventory.setItem(slot, null);
        }
    }
}
Also used : IconMenuItem(de.Keyle.MyPet.api.gui.IconMenuItem) ItemStack(net.minecraft.server.v1_9_R2.ItemStack) CraftItemStack(org.bukkit.craftbukkit.v1_9_R2.inventory.CraftItemStack)

Aggregations

IconMenuItem (de.Keyle.MyPet.api.gui.IconMenuItem)21 IconMenu (de.Keyle.MyPet.api.gui.IconMenu)3 TagCompound (de.keyle.knbt.TagCompound)2 ItemStack (net.minecraft.server.v1_10_R1.ItemStack)2 ItemStack (net.minecraft.server.v1_11_R1.ItemStack)2 ItemStack (net.minecraft.server.v1_12_R1.ItemStack)2 ItemStack (net.minecraft.server.v1_7_R4.ItemStack)2 ItemStack (net.minecraft.server.v1_8_R1.ItemStack)2 ItemStack (net.minecraft.server.v1_8_R2.ItemStack)2 ItemStack (net.minecraft.server.v1_8_R3.ItemStack)2 ItemStack (net.minecraft.server.v1_9_R1.ItemStack)2 ItemStack (net.minecraft.server.v1_9_R2.ItemStack)2 CraftItemStack (org.bukkit.craftbukkit.v1_10_R1.inventory.CraftItemStack)2 CraftItemStack (org.bukkit.craftbukkit.v1_11_R1.inventory.CraftItemStack)2 CraftItemStack (org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack)2 CraftItemStack (org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack)2 CraftItemStack (org.bukkit.craftbukkit.v1_8_R1.inventory.CraftItemStack)2 CraftItemStack (org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack)2 CraftItemStack (org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack)2 CraftItemStack (org.bukkit.craftbukkit.v1_9_R1.inventory.CraftItemStack)2