gdpc.world_slice¶
Provides the WorldSlice class
- class WorldSlice¶
Contains information on a slice of the world.
-
__init__(rect: Rect, dimension: str | None =
None, heightmapTypes: Iterable[str] | None =None, retries: int =0, timeout: Any =None, host: str ='http://localhost:9000')¶ Load a world slice.
If
heightmapTypesis None, all heightmaps are loaded.
- property nbt : NBTFile¶
The parsed NBT data for the chunks of this WorldSlice.
Its structure is described in the GDMC HTTP interface API.
- property heightmaps : dict[str, ndarray[tuple[int, ...], dtype[int64]]]¶
The heightmaps of this WorldSlice.
- getChunkSectionPositionGlobal(blockPosition: Vec3iLike) ivec3¶
Returns the local position of the chunk section that contains the global
blockPosition.
- getChunkSectionPosition(blockPosition: Vec3iLike) ivec3¶
Returns the local position of the chunk section that contains the local
blockPosition.
- getBlockStateTagGlobal(position: Vec3iLike) TAG_Compound | None¶
Returns the block state compound tag at global
position.If
positionis not contained in this WorldSlice, returns None.
- getBlockStateTag(position: Vec3iLike) TAG_Compound | None¶
Returns the block state compound tag at local
position.If
positionis not contained in this WorldSlice, returns None.
- getBlockGlobal(position: Vec3iLike) Block¶
Returns the block at global
position.If
positionis not contained in this WorldSlice, returns Block(“minecraft:void_air”).
- getBlock(position: Vec3iLike) Block¶
Returns the block at local
position.If
positionis not contained in this WorldSlice, returns Block(“minecraft:void_air”).
- getBiomeGlobal(position: Vec3iLike) str¶
Returns the namespaced id of the biome at global
position.If
positionis not contained in this WorldSlice, returns an empty string.Note that Minecraft stores biomes in groups of 4x4x4 blocks. This function returns the biome of
position’s group.
- getBiome(position: Vec3iLike) str¶
Returns the namespaced id of the biome at local
position.If
positionis not contained in this WorldSlice, returns an empty string.Note that Minecraft stores biomes in groups of 4x4x4 blocks. This function returns the biome of
position’s group.
- getBiomeCountsInChunkGlobal(position: Vec3iLike) dict[str, int] | None¶
Returns a dict of biomes in the same chunk as the global
position.If
positionis not contained in this WorldSlice, returns None.Minecraft stores biomes in groups of 4x4x4 blocks. The returned dict maps the namespaced id of a biome to the number of groups with that biome in the chunk.
- getBiomeCountsInChunk(position: Vec3iLike) dict[str, int] | None¶
Returns a dict of biomes in the same chunk as the local
position.If
positionis not contained in this WorldSlice, returns None.Minecraft stores biomes in groups of 4x4x4 blocks. The returned dict maps the namespaced id of a biome to the number of groups with that biome in the chunk.
-
__init__(rect: Rect, dimension: str | None =