Search in sources :

Example 31 with Inventory

use of org.bukkit.inventory.Inventory in project Essentials by drtshock.

the class InventoryWorkaround method makeTruncatedPlayerInventory.

private static Inventory makeTruncatedPlayerInventory(PlayerInventory playerInventory) {
    Inventory fakeInventory = Bukkit.getServer().createInventory(null, USABLE_PLAYER_INV_SIZE);
    fakeInventory.setContents(Arrays.copyOf(playerInventory.getContents(), fakeInventory.getSize()));
    return fakeInventory;
}
Also used : PlayerInventory(org.bukkit.inventory.PlayerInventory) Inventory(org.bukkit.inventory.Inventory)

Aggregations

Inventory (org.bukkit.inventory.Inventory)31 ItemStack (org.bukkit.inventory.ItemStack)15 InventoryHolder (org.bukkit.inventory.InventoryHolder)8 Player (org.bukkit.entity.Player)6 EventHandler (org.bukkit.event.EventHandler)6 PlayerInventory (org.bukkit.inventory.PlayerInventory)4 HashMap (java.util.HashMap)3 ItemActionInfo (com.gamingmesh.jobs.actions.ItemActionInfo)2 JobsPlayer (com.gamingmesh.jobs.container.JobsPlayer)2 Block (org.bukkit.block.Block)2 HumanEntity (org.bukkit.entity.HumanEntity)2 InventoryType (org.bukkit.event.inventory.InventoryType)2 AnvilInventory (org.bukkit.inventory.AnvilInventory)2 CraftingInventory (org.bukkit.inventory.CraftingInventory)2 EnchantingInventory (org.bukkit.inventory.EnchantingInventory)2 EntityHandle (com.bergerkiller.generated.net.minecraft.server.EntityHandle)1 IInventoryHandle (com.bergerkiller.generated.net.minecraft.server.IInventoryHandle)1 CraftEntityHandle (com.bergerkiller.generated.org.bukkit.craftbukkit.entity.CraftEntityHandle)1 CraftInventoryHandle (com.bergerkiller.generated.org.bukkit.craftbukkit.inventory.CraftInventoryHandle)1 Trade (com.earth2me.essentials.Trade)1