public abstract class BaseInventory extends Object implements org.cloudburstmc.api.inventory.Inventory
| Modifier and Type | Field and Description |
|---|---|
protected org.cloudburstmc.api.inventory.InventoryHolder |
holder |
protected int |
maxStackSize |
protected String |
name |
protected int |
size |
it.unimi.dsi.fastutil.ints.Int2ObjectMap<org.cloudburstmc.api.item.ItemStack> |
slots |
protected String |
title |
protected org.cloudburstmc.api.inventory.InventoryType |
type |
protected Set<CloudPlayer> |
viewers |
| Constructor and Description |
|---|
BaseInventory(org.cloudburstmc.api.inventory.InventoryHolder holder,
org.cloudburstmc.api.inventory.InventoryType type) |
BaseInventory(org.cloudburstmc.api.inventory.InventoryHolder holder,
org.cloudburstmc.api.inventory.InventoryType type,
Map<Integer,org.cloudburstmc.api.item.ItemStack> contents) |
BaseInventory(org.cloudburstmc.api.inventory.InventoryHolder holder,
org.cloudburstmc.api.inventory.InventoryType type,
Map<Integer,org.cloudburstmc.api.item.ItemStack> contents,
Integer overrideSize) |
BaseInventory(org.cloudburstmc.api.inventory.InventoryHolder holder,
org.cloudburstmc.api.inventory.InventoryType type,
Map<Integer,org.cloudburstmc.api.item.ItemStack> contents,
Integer overrideSize,
String overrideTitle) |
| Modifier and Type | Method and Description |
|---|---|
org.cloudburstmc.api.item.ItemStack[] |
addItem(org.cloudburstmc.api.item.ItemStack... slots) |
boolean |
addItemToFirstEmptySlot(org.cloudburstmc.api.item.ItemStack item) |
Map<Integer,org.cloudburstmc.api.item.ItemStack> |
all(org.cloudburstmc.api.item.ItemStack item) |
boolean |
canAddItem(org.cloudburstmc.api.item.ItemStack item) |
boolean |
clear(int index,
boolean send) |
void |
clearAll() |
void |
close(org.cloudburstmc.api.player.Player who) |
boolean |
contains(org.cloudburstmc.api.item.ItemStack item) |
void |
decrementCount(int slot) |
int |
first(org.cloudburstmc.api.item.ItemStack item,
boolean exact) |
int |
firstEmpty() |
int |
firstFit(org.cloudburstmc.api.item.ItemStack item,
boolean single) |
int |
firstNonEmpty() |
Map<Integer,org.cloudburstmc.api.item.ItemStack> |
getContents() |
protected int |
getEmptySlotsCount() |
int |
getFreeSpace(org.cloudburstmc.api.item.ItemStack item) |
org.cloudburstmc.api.inventory.InventoryHolder |
getHolder() |
CloudItemStack |
getItem(int index) |
int |
getMaxStackSize() |
String |
getName() |
int |
getSize() |
String |
getTitle() |
org.cloudburstmc.api.inventory.InventoryType |
getType() |
Set<CloudPlayer> |
getViewers() |
void |
incrementCount(int slot) |
boolean |
isEmpty() |
boolean |
isFull() |
void |
onClose(org.cloudburstmc.api.player.Player who) |
void |
onOpen(org.cloudburstmc.api.player.Player who) |
void |
onSlotChange(int index,
org.cloudburstmc.api.item.ItemStack before,
boolean send) |
boolean |
open(org.cloudburstmc.api.player.Player who) |
void |
remove(org.cloudburstmc.api.item.ItemStack item) |
org.cloudburstmc.api.item.ItemStack[] |
removeItem(org.cloudburstmc.api.item.ItemStack... slots) |
void |
sendContents(org.cloudburstmc.api.player.Player... players) |
void |
sendSlot(int index,
org.cloudburstmc.api.player.Player... players) |
void |
setContents(Map<Integer,org.cloudburstmc.api.item.ItemStack> items) |
boolean |
setItem(int index,
org.cloudburstmc.api.item.ItemStack item,
boolean send) |
void |
setMaxStackSize(int maxStackSize) |
void |
setSize(int size) |
protected final org.cloudburstmc.api.inventory.InventoryType type
protected int maxStackSize
protected int size
protected final String name
protected final String title
public final it.unimi.dsi.fastutil.ints.Int2ObjectMap<org.cloudburstmc.api.item.ItemStack> slots
protected final Set<CloudPlayer> viewers
protected org.cloudburstmc.api.inventory.InventoryHolder holder
public BaseInventory(org.cloudburstmc.api.inventory.InventoryHolder holder,
org.cloudburstmc.api.inventory.InventoryType type)
public BaseInventory(org.cloudburstmc.api.inventory.InventoryHolder holder,
org.cloudburstmc.api.inventory.InventoryType type,
Map<Integer,org.cloudburstmc.api.item.ItemStack> contents)
public BaseInventory(org.cloudburstmc.api.inventory.InventoryHolder holder,
org.cloudburstmc.api.inventory.InventoryType type,
Map<Integer,org.cloudburstmc.api.item.ItemStack> contents,
Integer overrideSize)
public int getSize()
getSize in interface org.cloudburstmc.api.inventory.Inventorypublic void setSize(int size)
public int getMaxStackSize()
getMaxStackSize in interface org.cloudburstmc.api.inventory.Inventorypublic String getName()
getName in interface org.cloudburstmc.api.inventory.Inventorypublic String getTitle()
getTitle in interface org.cloudburstmc.api.inventory.Inventory@Nonnull public CloudItemStack getItem(int index)
getItem in interface org.cloudburstmc.api.inventory.Inventorypublic Map<Integer,org.cloudburstmc.api.item.ItemStack> getContents()
getContents in interface org.cloudburstmc.api.inventory.Inventorypublic void setContents(Map<Integer,org.cloudburstmc.api.item.ItemStack> items)
setContents in interface org.cloudburstmc.api.inventory.Inventorypublic boolean setItem(int index,
org.cloudburstmc.api.item.ItemStack item,
boolean send)
setItem in interface org.cloudburstmc.api.inventory.Inventorypublic boolean contains(org.cloudburstmc.api.item.ItemStack item)
contains in interface org.cloudburstmc.api.inventory.Inventorypublic Map<Integer,org.cloudburstmc.api.item.ItemStack> all(org.cloudburstmc.api.item.ItemStack item)
all in interface org.cloudburstmc.api.inventory.Inventorypublic void remove(org.cloudburstmc.api.item.ItemStack item)
remove in interface org.cloudburstmc.api.inventory.Inventorypublic int first(org.cloudburstmc.api.item.ItemStack item,
boolean exact)
first in interface org.cloudburstmc.api.inventory.Inventorypublic int firstEmpty()
firstEmpty in interface org.cloudburstmc.api.inventory.Inventorypublic int firstNonEmpty()
firstNonEmpty in interface org.cloudburstmc.api.inventory.Inventorypublic int firstFit(org.cloudburstmc.api.item.ItemStack item,
boolean single)
firstFit in interface org.cloudburstmc.api.inventory.Inventorypublic void decrementCount(int slot)
decrementCount in interface org.cloudburstmc.api.inventory.Inventorypublic void incrementCount(int slot)
incrementCount in interface org.cloudburstmc.api.inventory.Inventorypublic boolean canAddItem(org.cloudburstmc.api.item.ItemStack item)
canAddItem in interface org.cloudburstmc.api.inventory.Inventorypublic org.cloudburstmc.api.item.ItemStack[] addItem(org.cloudburstmc.api.item.ItemStack... slots)
addItem in interface org.cloudburstmc.api.inventory.Inventoryprotected int getEmptySlotsCount()
public boolean addItemToFirstEmptySlot(org.cloudburstmc.api.item.ItemStack item)
public org.cloudburstmc.api.item.ItemStack[] removeItem(org.cloudburstmc.api.item.ItemStack... slots)
removeItem in interface org.cloudburstmc.api.inventory.Inventorypublic boolean clear(int index,
boolean send)
clear in interface org.cloudburstmc.api.inventory.Inventorypublic void clearAll()
clearAll in interface org.cloudburstmc.api.inventory.Inventorypublic Set<CloudPlayer> getViewers()
getViewers in interface org.cloudburstmc.api.inventory.Inventorypublic org.cloudburstmc.api.inventory.InventoryHolder getHolder()
getHolder in interface org.cloudburstmc.api.inventory.Inventorypublic void setMaxStackSize(int maxStackSize)
setMaxStackSize in interface org.cloudburstmc.api.inventory.Inventorypublic boolean open(org.cloudburstmc.api.player.Player who)
open in interface org.cloudburstmc.api.inventory.Inventorypublic void close(org.cloudburstmc.api.player.Player who)
close in interface org.cloudburstmc.api.inventory.Inventorypublic void onOpen(org.cloudburstmc.api.player.Player who)
onOpen in interface org.cloudburstmc.api.inventory.Inventorypublic void onClose(org.cloudburstmc.api.player.Player who)
onClose in interface org.cloudburstmc.api.inventory.Inventorypublic void onSlotChange(int index,
org.cloudburstmc.api.item.ItemStack before,
boolean send)
onSlotChange in interface org.cloudburstmc.api.inventory.Inventorypublic void sendContents(org.cloudburstmc.api.player.Player... players)
sendContents in interface org.cloudburstmc.api.inventory.Inventorypublic boolean isFull()
isFull in interface org.cloudburstmc.api.inventory.Inventorypublic boolean isEmpty()
isEmpty in interface org.cloudburstmc.api.inventory.Inventorypublic int getFreeSpace(org.cloudburstmc.api.item.ItemStack item)
getFreeSpace in interface org.cloudburstmc.api.inventory.Inventorypublic void sendSlot(int index,
org.cloudburstmc.api.player.Player... players)
sendSlot in interface org.cloudburstmc.api.inventory.Inventorypublic org.cloudburstmc.api.inventory.InventoryType getType()
getType in interface org.cloudburstmc.api.inventory.InventoryCopyright © 2021. All rights reserved.