程序包 org.bukkit.block
接口 Structure
- 所有超级接口:
BlockState
,Metadatable
Represents a structure block that can save and load blocks from a file. They
can only be used by OPs, and are not obtainable in survival.
-
方法概要
修饰符和类型方法说明Get the name of who created this structure.float
Get the integrity of this structure.Get the metadata function this structure block will perform when activated.How this structure is mirrored.The relative position of the structure outline based on the position of the structure block.Get how this structure is rotated.long
getSeed()
The seed used to determine how many blocks are removed upon loading of this structure.The name of this structure.The distance to the opposite corner of this structure.Get theUsageMode
of this structure block.boolean
Get if this structure block is currently showing the bounding box.boolean
Get if this structure block should ignore entities.boolean
Check if this structure block is currently showing all air blocksvoid
Set the name of whoever created this structure.void
setAuthor
(LivingEntity livingEntity) Set the name of whoever created this structure using aLivingEntity
.void
setBoundingBoxVisible
(boolean showBoundingBox) Set if this structure box should show the bounding box.void
setIgnoreEntities
(boolean ignoreEntities) While inUsageMode.SAVE
mode, this will ignore any entities when saving the structure.void
setIntegrity
(float integrity) Set the integrity of the structure.void
setMetadata
(String metadata) Only applicable while inUsageMode.DATA
.void
Sets the mirroring of the structure.void
setRelativePosition
(BlockVector vector) Set the relative position from the structure block.void
setRotation
(StructureRotation rotation) Set how this structure is rotated.void
setSeed
(long seed) The seed used to determine which blocks will be removed upon loading.void
setShowAir
(boolean showAir) Set if the structure outline should show air blocks.void
setStructureName
(String name) Set the name of this structure.void
setStructureSize
(BlockVector vector) Set the maximum size of this structure from the origin point.void
setUsageMode
(UsageMode mode) Set theUsageMode
of this structure block.从接口继承的方法 org.bukkit.block.BlockState
getBlock, getChunk, getData, getLightLevel, getLocation, getLocation, getRawData, getType, getTypeId, getWorld, getX, getY, getZ, isPlaced, setData, setRawData, setType, setTypeId, update, update, update
从接口继承的方法 org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
-
方法详细资料
-
getStructureName
String getStructureName()The name of this structure.- 返回:
- structure name
-
setStructureName
Set the name of this structure. This is case-sensitive. The name of the structure in theUsageMode.SAVE
structure block MUST match the name within theUsageMode.CORNER
block or the size calculation will fail.- 参数:
name
- the case-sensitive name of this structure
-
getAuthor
String getAuthor()Get the name of who created this structure.- 返回:
- the name of whoever created this structure.
-
setAuthor
Set the name of whoever created this structure.- 参数:
author
- whoever created this structure
-
setAuthor
Set the name of whoever created this structure using aLivingEntity
.- 参数:
livingEntity
- the entity who created this structure
-
getRelativePosition
BlockVector getRelativePosition()The relative position of the structure outline based on the position of the structure block. Maximum allowed distance is 32 blocks in any direction.- 返回:
- a Location which contains the relative distance this structure is from the structure block.
-
setRelativePosition
Set the relative position from the structure block. Maximum allowed distance is 32 blocks in any direction.- 参数:
vector
- theBlockVector
containing the relative origin coordinates of this structure.
-
getStructureSize
BlockVector getStructureSize()The distance to the opposite corner of this structure. The maximum structure size is 32x32x32. When a structure has successfully been calculated (i.e. it is within the maximum allowed distance) a white border surrounds the structure.- 返回:
- a
BlockVector
which contains the total size of the structure.
-
setStructureSize
Set the maximum size of this structure from the origin point. Maximum allowed size is 32x32x32.- 参数:
vector
- theBlockVector
containing the size of this structure, based off of the origin coordinates.
-
setMirror
Sets the mirroring of the structure.- 参数:
mirror
- the new mirroring method
-
getMirror
Mirror getMirror()How this structure is mirrored.- 返回:
- the current mirroring method
-
setRotation
Set how this structure is rotated.- 参数:
rotation
- the new rotation
-
getRotation
StructureRotation getRotation()Get how this structure is rotated.- 返回:
- the new rotation
-
setUsageMode
Set theUsageMode
of this structure block.- 参数:
mode
- the new mode to set.
-
getUsageMode
UsageMode getUsageMode()Get theUsageMode
of this structure block.- 返回:
- the mode this block is currently in.
-
setIgnoreEntities
void setIgnoreEntities(boolean ignoreEntities) While inUsageMode.SAVE
mode, this will ignore any entities when saving the structure.
While inUsageMode.LOAD
mode this will ignore any entities that were saved to file.- 参数:
ignoreEntities
- the flag to set
-
isIgnoreEntities
boolean isIgnoreEntities()Get if this structure block should ignore entities.- 返回:
- true if the appropriate
UsageMode
should ignore entities.
-
setShowAir
void setShowAir(boolean showAir) Set if the structure outline should show air blocks.- 参数:
showAir
- if the structure block should show air blocks
-
isShowAir
boolean isShowAir()Check if this structure block is currently showing all air blocks- 返回:
- true if the structure block is showing all air blocks
-
setBoundingBoxVisible
void setBoundingBoxVisible(boolean showBoundingBox) Set if this structure box should show the bounding box.- 参数:
showBoundingBox
- if the structure box should be shown
-
isBoundingBoxVisible
boolean isBoundingBoxVisible()Get if this structure block is currently showing the bounding box.- 返回:
- true if the bounding box is shown
-
setIntegrity
void setIntegrity(float integrity) Set the integrity of the structure. Integrity must be between 0.0 and 1.0 Lower integrity values will result in more blocks being removed when loading a structure. Integrity andgetSeed()
are used together to determine which blocks are randomly removed to mimic "decay."- 参数:
integrity
- the integrity of this structure
-
getIntegrity
float getIntegrity()Get the integrity of this structure.- 返回:
- the integrity of this structure
-
setSeed
void setSeed(long seed) The seed used to determine which blocks will be removed upon loading.getIntegrity()
and seed are used together to determine which blocks are randomly removed to mimic "decay."- 参数:
seed
- the seed used to determine how many blocks will be removed
-
getSeed
long getSeed()The seed used to determine how many blocks are removed upon loading of this structure.- 返回:
- the seed used
-
setMetadata
Only applicable while inUsageMode.DATA
. Metadata are specific functions that can be applied to the structure location. Consult the Minecraft wiki for more information.- 参数:
metadata
- the function to perform on the selected location
-
getMetadata
String getMetadata()Get the metadata function this structure block will perform when activated. Consult the Minecraft Wiki for more information.- 返回:
- the function that will be performed when this block is activated
-