Package cn.nukkit.inventory
Class CampfireInventory
java.lang.Object
cn.nukkit.inventory.BaseInventory
cn.nukkit.inventory.ContainerInventory
cn.nukkit.inventory.CampfireInventory
- All Implemented Interfaces:
Inventory
-
Field Summary
Fields inherited from class cn.nukkit.inventory.BaseInventory
AIR_ITEM, holder, maxStackSize, name, size, slots, title, type, viewers
-
Constructor Summary
ConstructorDescriptionCampfireInventory
(BlockEntityCampfire campfire) CampfireInventory
(BlockEntityCampfire furnace, InventoryType inventoryType) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canAddItem
(Item item) int
获取最大库存大小void
onSlotChange
(int index, Item before, boolean send) 当执行Inventory.setItem(int, Item)
时该方法会被调用,此时物品已经put进slotsMethods inherited from class cn.nukkit.inventory.ContainerInventory
calculateRedstone, canCauseVibration, onClose, onOpen
Methods inherited from class cn.nukkit.inventory.BaseInventory
addItem, addListener, all, clear, clearAll, close, contains, decreaseCount, first, firstEmpty, getContents, getFreeSpace, getItem, getName, getSize, getTitle, getType, getUnclonedItem, getViewers, isEmpty, isFull, open, remove, removeItem, removeListener, sendContents, sendContents, sendContents, sendSlot, sendSlot, sendSlot, setContents, setItem, setMaxStackSize, setSize
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cn.nukkit.inventory.Inventory
clear, first, setItem, setItemByPlayer
-
Constructor Details
-
CampfireInventory
-
CampfireInventory
-
-
Method Details
-
getHolder
- Specified by:
getHolder
in interfaceInventory
- Overrides:
getHolder
in classBaseInventory
-
onSlotChange
Description copied from interface:Inventory
当执行Inventory.setItem(int, Item)
时该方法会被调用,此时物品已经put进slotsThis method is called when
Inventory.setItem(int, Item)
is executed, and the item has been put into slots- Specified by:
onSlotChange
in interfaceInventory
- Overrides:
onSlotChange
in classBaseInventory
- Parameters:
index
- 物品变动的格子索引
The grid index of the item's changesbefore
- 变动前的物品
Items before the changesend
- 是否发送InventorySlotPacket
到客户端
Whether to sendInventorySlotPacket
to the client
-
getMaxStackSize
public int getMaxStackSize()Description copied from interface:Inventory
获取最大库存大小- Specified by:
getMaxStackSize
in interfaceInventory
- Overrides:
getMaxStackSize
in classBaseInventory
-
canAddItem
- Specified by:
canAddItem
in interfaceInventory
- Overrides:
canAddItem
in classBaseInventory
-