Package cn.nukkit.blockentity
Class BlockEntityChest
- All Implemented Interfaces:
BlockEntityContainer
,BlockEntityNameable
,InventoryHolder
,Cloneable
- Author:
- MagicDroidX (Nukkit Project)
-
Field Summary
FieldsFields inherited from class cn.nukkit.blockentity.BlockEntitySpawnableContainer
inventory
Fields inherited from class cn.nukkit.blockentity.BlockEntity
BANNER, BARREL, BEACON, BED, BEEHIVE, BELL, BLAST_FURNACE, BREWING_STAND, CAMPFIRE, CAULDRON, CHEST, chunk, closed, COMMAND_BLOCK, COMPARATOR, CONDUIT, count, DAYLIGHT_DETECTOR, DISPENSER, DROPPER, ENCHANT_TABLE, END_GATEWAY, END_PORTAL, ENDER_CHEST, FLOWER_POT, FURNACE, GLOW_ITEM_FRAME, HOPPER, id, ITEM_FRAME, JUKEBOX, lastUpdate, LECTERN, LODESTONE, MOB_SPAWNER, movable, MOVING_BLOCK, MUSIC, name, namedTag, NETHER_REACTOR, PISTON_ARM, SCULK_CATALYST, SCULK_SENSOR, SCULK_SHRIEKER, server, SHULKER_BOX, SIGN, SKULL, SMOKER, STRUCTURE_BLOCK, TARGET, timing
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
close()
void
createPair
(BlockEntityChest chest) getName()
返回这个事物的名字。
Gets the name of this object.getPair()
int
getSize()
返回这个容器最多能包含的物品数量。
Returns the max number of items that this container can contain.boolean
hasName()
返回这个事物是否有名字。
Whether this object has a name.boolean
boolean
isPaired()
void
onBreak()
boolean
pairWith
(BlockEntityChest chest) protected ContainerInventory
继承于此类的容器方块实体必须实现此方法void
设置或更改这个事物的名字。
Changes the name of this object, or names it.boolean
unpair()
Methods inherited from class cn.nukkit.blockentity.BlockEntitySpawnableContainer
getItem, getSlotIndex, loadNBT, saveNBT, setItem
Methods inherited from class cn.nukkit.blockentity.BlockEntitySpawnable
getSpawnPacket, getSpawnPacket, initBlockEntity, spawnTo, spawnToAll, updateCompoundTag
Methods inherited from class cn.nukkit.blockentity.BlockEntity
createBlockEntity, createBlockEntity, createBlockEntity, getBlock, getDefaultCompound, getId, getLevelBlockEntity, getSaveId, init, isMovable, isObservable, onBreak, onUpdate, registerBlockEntity, scheduleUpdate, setDirty
Methods inherited from class cn.nukkit.level.Position
abs, add, add, add, add, ceil, clone, divide, floor, fromObject, fromObject, getChunk, getLevel, getLevelBlock, getLevelBlock, getLevelBlock, getLevelBlockAround, getLevelBlockAtLayer, getLevelBlockState, getLevelBlockState, getLevelName, getLocation, getSide, getSide, getSidePos, getTickCachedLevelBlock, getTickCachedLevelBlockAtLayer, getTypedBlockEntity, getValidLevel, isValid, multiply, round, setComponents, setComponents, setLevel, setStrong, setWeak, subtract, subtract, subtract, subtract, subtract, toString
Methods inherited from class cn.nukkit.positiontracking.NamedPosition
matchesNamedPosition
Methods inherited from class cn.nukkit.math.Vector3
asBlockVector3, asVector3f, cross, distance, distance, distanceManhattan, distanceSquared, distanceSquared, dot, down, down, east, east, equals, getAxis, getChunkSectionY, getChunkVector, getChunkX, getChunkZ, getFloorX, getFloorY, getFloorZ, getForward, getIntermediateWithXValue, getIntermediateWithYValue, getIntermediateWithZValue, getRight, getSideVec, getSouth, getUp, getWest, getX, getY, getZ, hashCode, length, lengthSquared, maxPlainDistance, maxPlainDistance, maxPlainDistance, maxPlainDistance, maxPlainDistance, normalize, north, north, rawHashCode, setComponentsAdding, setComponentsAdding, setX, setY, setZ, south, south, up, up, west, west
-
Field Details
-
doubleInventory
-
-
Constructor Details
-
BlockEntityChest
-
-
Method Details
-
requireContainerInventory
Description copied from class:BlockEntitySpawnableContainer
继承于此类的容器方块实体必须实现此方法- Specified by:
requireContainerInventory
in classBlockEntitySpawnableContainer
- Returns:
- ContainerInventory
-
close
public void close()- Overrides:
close
in classBlockEntitySpawnableContainer
-
isBlockEntityValid
public boolean isBlockEntityValid()- Specified by:
isBlockEntityValid
in classBlockEntity
-
getSize
public int getSize()Description copied from interface:BlockEntityContainer
返回这个容器最多能包含的物品数量。
Returns the max number of items that this container can contain.- Specified by:
getSize
in interfaceBlockEntityContainer
- Returns:
- 最多能包含的物品数量。
The max number.
-
getInventory
- Specified by:
getInventory
in interfaceInventoryHolder
-
getRealInventory
-
checkPairing
protected void checkPairing() -
isPaired
public boolean isPaired() -
getPair
-
pairWith
-
createPair
-
unpair
public boolean unpair() -
getSpawnCompound
- Overrides:
getSpawnCompound
in classBlockEntitySpawnable
-
getCleanedNBT
- Overrides:
getCleanedNBT
in classBlockEntity
-
getName
Description copied from interface:BlockEntityNameable
返回这个事物的名字。
Gets the name of this object.- Specified by:
getName
in interfaceBlockEntityNameable
- Overrides:
getName
in classBlockEntity
- Returns:
- 这个事物的名字。
The name of this object.
-
hasName
public boolean hasName()Description copied from interface:BlockEntityNameable
返回这个事物是否有名字。
Whether this object has a name.- Specified by:
hasName
in interfaceBlockEntityNameable
- Returns:
- 如果有名字,返回
true
。true
for this object has a name.
-
setName
Description copied from interface:BlockEntityNameable
设置或更改这个事物的名字。
Changes the name of this object, or names it.- Specified by:
setName
in interfaceBlockEntityNameable
- Parameters:
name
- 这个事物的新名字。
The new name of this object.
-
onBreak
public void onBreak()- Overrides:
onBreak
in classBlockEntitySpawnableContainer
-