Search in sources :

Example 11 with CustomInventory

use of de.Keyle.MyPet.compat.v1_9_R2.util.inventory.CustomInventory in project MyPet by xXKeyleXx.

the class IconMenuInventory method open.

@Override
public void open(IconMenu menu, HumanEntity player) {
    size = menu.getSize();
    minecraftInventory = new CustomInventory(size, menu.getTitle());
    for (int slot = 0; slot < size; slot++) {
        IconMenuItem menuItem = menu.getOption(slot);
        if (menuItem != null) {
            ItemStack item = createItemStack(menuItem);
            minecraftInventory.setItem(slot, item);
        }
    }
    player.openInventory(minecraftInventory.getBukkitInventory());
}
Also used : IconMenuItem(de.Keyle.MyPet.api.gui.IconMenuItem) ItemStack(net.minecraft.server.v1_8_R2.ItemStack) CraftItemStack(org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack) CustomInventory(de.Keyle.MyPet.compat.v1_8_R2.util.inventory.CustomInventory)

Example 12 with CustomInventory

use of de.Keyle.MyPet.compat.v1_9_R2.util.inventory.CustomInventory in project MyPet by xXKeyleXx.

the class IconMenuInventory method open.

@Override
public void open(IconMenu menu, HumanEntity player) {
    size = menu.getSize();
    minecraftInventory = new CustomInventory(size, menu.getTitle());
    for (int slot = 0; slot < size; slot++) {
        IconMenuItem menuItem = menu.getOption(slot);
        if (menuItem != null) {
            ItemStack item = createItemStack(menuItem);
            minecraftInventory.setItem(slot, item);
        }
    }
    player.openInventory(minecraftInventory.getBukkitInventory());
}
Also used : IconMenuItem(de.Keyle.MyPet.api.gui.IconMenuItem) ItemStack(net.minecraft.server.v1_9_R1.ItemStack) CraftItemStack(org.bukkit.craftbukkit.v1_9_R1.inventory.CraftItemStack) CustomInventory(de.Keyle.MyPet.compat.v1_9_R1.util.inventory.CustomInventory)

Example 13 with CustomInventory

use of de.Keyle.MyPet.compat.v1_9_R2.util.inventory.CustomInventory in project MyPet by xXKeyleXx.

the class IconMenuInventory method open.

@Override
public void open(IconMenu menu, HumanEntity player) {
    size = menu.getSize();
    minecraftInventory = new CustomInventory(size, menu.getTitle());
    for (int slot = 0; slot < size; slot++) {
        IconMenuItem menuItem = menu.getOption(slot);
        if (menuItem != null) {
            ItemStack item = createItemStack(menuItem);
            minecraftInventory.setItem(slot, item);
        }
    }
    player.openInventory(minecraftInventory.getBukkitInventory());
}
Also used : IconMenuItem(de.Keyle.MyPet.api.gui.IconMenuItem) CraftItemStack(org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack) ItemStack(net.minecraft.server.v1_12_R1.ItemStack) CustomInventory(de.Keyle.MyPet.compat.v1_12_R1.util.inventory.CustomInventory)

Aggregations

IconMenuItem (de.Keyle.MyPet.api.gui.IconMenuItem)13 ItemStack (net.minecraft.world.item.ItemStack)2 CustomInventory (de.Keyle.MyPet.compat.v1_10_R1.util.inventory.CustomInventory)1 CustomInventory (de.Keyle.MyPet.compat.v1_11_R1.util.inventory.CustomInventory)1 CustomInventory (de.Keyle.MyPet.compat.v1_12_R1.util.inventory.CustomInventory)1 CustomInventory (de.Keyle.MyPet.compat.v1_16_R1.util.inventory.CustomInventory)1 CustomInventory (de.Keyle.MyPet.compat.v1_16_R3.util.inventory.CustomInventory)1 CustomInventory (de.Keyle.MyPet.compat.v1_17_R1.util.inventory.CustomInventory)1 CustomInventory (de.Keyle.MyPet.compat.v1_18_R1.util.inventory.CustomInventory)1 CustomInventory (de.Keyle.MyPet.compat.v1_7_R4.util.inventory.CustomInventory)1 CustomInventory (de.Keyle.MyPet.compat.v1_8_R1.util.inventory.CustomInventory)1 CustomInventory (de.Keyle.MyPet.compat.v1_8_R2.util.inventory.CustomInventory)1 CustomInventory (de.Keyle.MyPet.compat.v1_8_R3.util.inventory.CustomInventory)1 CustomInventory (de.Keyle.MyPet.compat.v1_9_R1.util.inventory.CustomInventory)1 CustomInventory (de.Keyle.MyPet.compat.v1_9_R2.util.inventory.CustomInventory)1 ItemStack (net.minecraft.server.v1_10_R1.ItemStack)1 ItemStack (net.minecraft.server.v1_11_R1.ItemStack)1 ItemStack (net.minecraft.server.v1_12_R1.ItemStack)1 ItemStack (net.minecraft.server.v1_7_R4.ItemStack)1 ItemStack (net.minecraft.server.v1_8_R1.ItemStack)1