Package cn.nukkit.blockentity
Class BlockEntitySign
java.lang.Object
cn.nukkit.math.Vector3
cn.nukkit.positiontracking.NamedPosition
cn.nukkit.level.Position
cn.nukkit.blockentity.BlockEntity
cn.nukkit.blockentity.BlockEntitySpawnable
cn.nukkit.blockentity.BlockEntitySign
- All Implemented Interfaces:
Cloneable
- Author:
- MagicDroidX (Nukkit Project)
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
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
-
Method Summary
Modifier and TypeMethodDescriptiongetColor()
getColor
(boolean front) long
设置编辑此告示牌的玩家的运行时实体 ID。只有此玩家才能编辑告示牌。这用于防止多个玩家同时编辑同一告示牌,并防止玩家编辑他们未放置的告示牌。String[]
getText()
String[]
getText
(boolean front) boolean
boolean
boolean
isGlowing
(boolean front) void
loadNBT()
从方块实体的namedtag中读取数据void
saveNBT()
存储方块实体数据到namedtagvoid
setColor
(boolean front, BlockColor color) void
setColor
(BlockColor color) void
setEditorEntityRuntimeId
(Long editorEntityRuntimeId) void
setGlowing
(boolean glowing) void
setGlowing
(boolean front, boolean glowing) boolean
设置lines文本数组到Sign对象,同时更新NBTboolean
boolean
updateCompoundTag
(CompoundTag nbt, Player player) Called when a player updates a block entity's NBT data for example when writing on a sign.Methods inherited from class cn.nukkit.blockentity.BlockEntitySpawnable
getSpawnPacket, getSpawnPacket, initBlockEntity, spawnTo, spawnToAll
Methods inherited from class cn.nukkit.blockentity.BlockEntity
close, createBlockEntity, createBlockEntity, createBlockEntity, getBlock, getCleanedNBT, getDefaultCompound, getId, getLevelBlockEntity, getName, getSaveId, init, isMovable, isObservable, onBreak, 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
-
TAG_TEXT_BLOB
- See Also:
-
TAG_TEXT_LINE
- See Also:
-
TAG_TEXT_COLOR
- See Also:
-
TAG_GLOWING_TEXT
- See Also:
-
TAG_PERSIST_FORMATTING
- See Also:
-
TAG_LEGACY_BUG_RESOLVE
- See Also:
-
TAG_FRONT_TEXT
- See Also:
-
TAG_BACK_TEXT
- See Also:
-
TAG_WAXED
- See Also:
-
TAG_LOCKED_FOR_EDITING_BY
- See Also:
-
-
Constructor Details
-
BlockEntitySign
-
-
Method Details
-
loadNBT
Description copied from class:BlockEntity
从方块实体的namedtag中读取数据- Overrides:
loadNBT
in classBlockEntity
-
saveNBT
public void saveNBT()Description copied from class:BlockEntity
存储方块实体数据到namedtag- Overrides:
saveNBT
in classBlockEntity
-
isBlockEntityValid
public boolean isBlockEntityValid()- Specified by:
isBlockEntityValid
in classBlockEntity
-
setText
-
setText
设置lines文本数组到Sign对象,同时更新NBT- Parameters:
front
- the frontlines
- the lines- Returns:
- the text
-
getText
-
getText
-
getEditorEntityRuntimeId
public long getEditorEntityRuntimeId()设置编辑此告示牌的玩家的运行时实体 ID。只有此玩家才能编辑告示牌。这用于防止多个玩家同时编辑同一告示牌,并防止玩家编辑他们未放置的告示牌。Sets the runtime entity ID of the player editing this sign. Only this player will be able to edit the sign. This is used to prevent multiple players from editing the same sign at the same time, and to prevent players from editing signs they didn't place.
-
setEditorEntityRuntimeId
-
getColor
-
getColor
-
setColor
-
setColor
-
isGlowing
public boolean isGlowing() -
isGlowing
public boolean isGlowing(boolean front) -
setGlowing
public void setGlowing(boolean glowing) -
setGlowing
public void setGlowing(boolean front, boolean glowing) -
updateCompoundTag
Description copied from class:BlockEntitySpawnable
Called when a player updates a block entity's NBT data for example when writing on a sign.- Overrides:
updateCompoundTag
in classBlockEntitySpawnable
- Parameters:
nbt
- tagplayer
- player- Returns:
- bool indication of success, will respawn the tile to the player if false.
-
getSpawnCompound
- Overrides:
getSpawnCompound
in classBlockEntitySpawnable
-