程序包 org.bukkit
接口 Chunk
public interface Chunk
代表一个16*256*16的空间
-
方法概要
修饰符和类型方法说明getBlock(int x, int y, int z) 从区块中获取某个方块(Block).Capture thread-safe read-only snapshot of chunk datagetChunkSnapshot(boolean includeMaxblocky, boolean includeBiome, boolean includeBiomeTempRain) Capture thread-safe read-only snapshot of chunk dataEntity[]获取该区块内所有实体(Entity)列表数组.获取该区块内所有的TileEntity的列表.getWorld()获取该区块属于哪个世界.intgetX()获取该区块的X轴坐标.intgetZ()获取该区块的Z轴坐标.booleanisLoaded()返回该区块是否被加载.booleanChecks if this chunk can spawn slimes without being a swamp biome.booleanload()加载区块.booleanload(boolean generate) 加载区块.booleanunload()卸载并可选是否保存区块.booleanunload(boolean save) 卸载该区块.可以选择是否保存.booleanunload(boolean save, boolean safe) 已过时。移除一个正在使用的区块从不安全
-
方法详细资料
-
getX
int getX()获取该区块的X轴坐标.原文:Gets the X-coordinate of this chunk
- 返回:
- 区块X轴坐标
-
getZ
int getZ()获取该区块的Z轴坐标.Gets the Z-coordinate of this chunk
- 返回:
- 区块的Z轴坐标
-
getWorld
World getWorld()获取该区块属于哪个世界.原文:Gets the world containing this chunk
- 返回:
- 世界名
-
getBlock
从区块中获取某个方块(Block).原文:Gets a block from this chunk
- 参数:
x- 获取方块的X轴坐标,在0-15之间y- 获取方块的Y轴坐标,在0-255之间z- 获取方块的Z轴坐标,在0-15之间- 返回:
- 方块对象
-
getChunkSnapshot
ChunkSnapshot getChunkSnapshot()Capture thread-safe read-only snapshot of chunk data- 返回:
- ChunkSnapshot
-
getChunkSnapshot
ChunkSnapshot getChunkSnapshot(boolean includeMaxblocky, boolean includeBiome, boolean includeBiomeTempRain) Capture thread-safe read-only snapshot of chunk data- 参数:
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 rainfall- 返回:
- ChunkSnapshot
-
getEntities
Entity[] getEntities()获取该区块内所有实体(Entity)列表数组.Get a list of all entities in the chunk.
- 返回:
- The entities.
-
getTileEntities
BlockState[] getTileEntities()获取该区块内所有的TileEntity的列表.原文:Get a list of all tile entities in the chunk.
- 返回:
- 实体列表数组
-
isLoaded
boolean isLoaded()返回该区块是否被加载.原文:Checks if the chunk is loaded.
- 返回:
- 成功加载返回true,否则返回false
-
load
boolean load(boolean generate) 加载区块.- 参数:
generate- 如果该区块不存在是否自动生成- 返回:
- 成功加载返回true,反之返回false
-
load
boolean load()加载区块.- 返回:
- 成功加载返回true,反之返回false
-
unload
已过时。移除一个正在使用的区块从不安全卸载并可选是否保存区块-安全模式.原文:Unloads and optionally saves the Chunk
- 参数:
save- 卸载时是否保存safe- 当该区块内存在玩家时是否继续卸载- 返回:
- 成功卸载返回true,反之返回false
-
unload
boolean unload(boolean save) 卸载该区块.可以选择是否保存.原文:Unloads and optionally saves the Chunk
- 参数:
save- 卸载时是否保存.- 返回:
- 成功卸载返回true,反之返回false
-
unload
boolean unload()卸载并可选是否保存区块.原文:Unloads and optionally saves the Chunk
- 返回:
- 成功卸载返回true,反之返回false
-
isSlimeChunk
boolean isSlimeChunk()Checks if this chunk can spawn slimes without being a swamp biome.- 返回:
- true if slimes are able to spawn in this chunk
-