public interface Chunk
限定符和类型 | 方法和说明 |
---|---|
Block |
getBlock(int x,
int y,
int z)
从区块中获取某个方块(
Block ). |
ChunkSnapshot |
getChunkSnapshot()
Capture thread-safe read-only snapshot of chunk data
|
ChunkSnapshot |
getChunkSnapshot(boolean includeMaxblocky,
boolean includeBiome,
boolean includeBiomeTempRain)
Capture thread-safe read-only snapshot of chunk data
|
Entity[] |
getEntities()
获取该区块内所有实体(
Entity )列表数组. |
BlockState[] |
getTileEntities()
获取该区块内所有的TileEntity的列表.
|
World |
getWorld()
获取该区块属于哪个世界.
|
int |
getX()
获取该区块的X轴坐标.
|
int |
getZ()
获取该区块的Z轴坐标.
|
boolean |
isLoaded()
返回该区块是否被加载.
|
boolean |
isSlimeChunk()
Checks if this chunk can spawn slimes without being a swamp biome.
|
boolean |
load()
加载区块.
|
boolean |
load(boolean generate)
加载区块.
|
boolean |
unload()
卸载并可选是否保存区块.
|
boolean |
unload(boolean save)
卸载该区块.可以选择是否保存.
|
boolean |
unload(boolean save,
boolean safe)
已过时。
移除一个正在使用的区块从不安全
|
int getX()
原文:Gets the X-coordinate of this chunk
int getZ()
Gets the Z-coordinate of this chunk
World getWorld()
原文:Gets the world containing this chunk
Block getBlock(int x, int y, int z)
Block
).
原文:Gets a block from this chunk
x
- 获取方块的X轴坐标,在0-15之间y
- 获取方块的Y轴坐标,在0-255之间z
- 获取方块的Z轴坐标,在0-15之间ChunkSnapshot getChunkSnapshot()
ChunkSnapshot getChunkSnapshot(boolean includeMaxblocky, boolean includeBiome, boolean includeBiomeTempRain)
includeMaxblocky
- - if true, snapshot includes per-coordinate
maximum Y valuesincludeBiome
- - if true, snapshot includes per-coordinate biome
typeincludeBiomeTempRain
- - if true, snapshot includes per-coordinate
raw biome temperature and rainfallEntity[] getEntities()
Entity
)列表数组. Get a list of all entities in the chunk.
BlockState[] getTileEntities()
原文:Get a list of all tile entities in the chunk.
boolean isLoaded()
原文:Checks if the chunk is loaded.
boolean load(boolean generate)
generate
- 如果该区块不存在是否自动生成boolean load()
@Deprecated boolean unload(boolean save, boolean safe)
原文:Unloads and optionally saves the Chunk
save
- 卸载时是否保存safe
- 当该区块内存在玩家时是否继续卸载boolean unload(boolean save)
原文:Unloads and optionally saves the Chunk
save
- 卸载时是否保存.boolean unload()
原文:Unloads and optionally saves the Chunk
boolean isSlimeChunk()