Package cn.nukkit.blockentity
Interface BlockEntityContainer
- All Known Implementing Classes:
BlockEntityBarrel
,BlockEntityBlastFurnace
,BlockEntityBrewingStand
,BlockEntityCampfire
,BlockEntityChest
,BlockEntityDispenser
,BlockEntityDropper
,BlockEntityEjectable
,BlockEntityFurnace
,BlockEntityHopper
,BlockEntityShulkerBox
,BlockEntitySmoker
,BlockEntitySpawnableContainer
public interface BlockEntityContainer
表达一个容器的接口。
An interface describes a container.
An interface describes a container.
BlockEntityContainer
容器必须包含物品的Item
对象。
A BlockEntityContainer
must contain items as Item
objects.
- Since:
- Nukkit 1.0 | Nukkit API 1.0.0
- Author:
- MagicDroidX(code) @ Nukkit Project, 粉鞋大妈(javadoc) @ Nukkit Project
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetItem
(int index) 返回一个存储在容器里的物品的Item
对象。
Returns an item that stores in this container, as anItem
object.int
getSize()
返回这个容器最多能包含的物品数量。
Returns the max number of items that this container can contain.void
把一个物品存储进容器。
Sets or stores this item into this container.
-
Method Details
-
getItem
返回一个存储在容器里的物品的Item
对象。
Returns an item that stores in this container, as anItem
object.- Parameters:
index
- 这个物品的索引序号。
The index number of this item.- Returns:
- 这个物品的
Item
对象。
AnItem
object for this item. - Since:
- Nukkit 1.0 | Nukkit API 1.0.0
-
setItem
把一个物品存储进容器。
Sets or stores this item into this container.注意:如果这个容器相应的索引序号已经有了物品,那么新存储的物品将会替换原有的物品。
Notice: If there is already an item for this index number, the new item being stored will REPLACE the old one.- Parameters:
index
- 这个物品的索引序号。
The index number of this item.item
- 描述这个物品的Item
对象。
TheItem
object that describes this item.- Since:
- Nukkit 1.0 | Nukkit API 1.0.0
-
getSize
int getSize()返回这个容器最多能包含的物品数量。
Returns the max number of items that this container can contain.- Returns:
- 最多能包含的物品数量。
The max number. - Since:
- Nukkit 1.0 | Nukkit API 1.0.0
-