This library is a python interface for cubiomes
Project description
Cubiomes Python Interface (CPI) Documentation
Overview
The Cubiomes Python Interface (CPI) is a python interface for Cubiomes
Classes
Generator
Stores data about the Minecraft world generator.
- Attributes:
version
(int): Minecraft version number.seed
(int): Random seed for world generation.dimension
(int): Dimension ID.
Dimension
Defines Minecraft dimensions with constants.
Constants:
DIM_NETHER = -1
DIM_OVERWORLD = 0
DIM_END = 1
DIM_UNDEF = 1000
MCVersion
Defines Minecraft version constants.
Constants:
MC_1_0_0 = 3
MC_1_1_0 = 4
MC_1_2_5 = 5
... (and so on up to MC_1_20)
Structure
Defines various Minecraft structures with constants.
Constants:
Feature = 0
Desert_Pyramid = 1
Jungle_Temple = 2
... (and so on)
BiomeID
Defines Minecraft biomes with constants.
Constants:
none = -1
ocean = 0
plains = 1
... (and so on, including custom biomes)
BiomeGroups
Groups of biomes for convenience.
Attributes:
Forests
Beaches
DesertBiomes
Oceans
BastionType
Defines various bastion types.
Constants:
HOUSING = 0
STABLES = 1
TREASURE = 2
BRIDGE = 3
Functions
distance_between_structures(structure1, structure2) -> float
Calculates the distance between two structures.
Parameters:
structure1 (tuple[int, int]): Coordinates of the first structure.
structure2 (tuple[int, int]): Coordinates of the second structure.
Returns:
float: Distance between the two structures.
distance_from_00(c1) -> float
Calculates the distance from the origin (0,0) to a given coordinate.
Parameters:
c1 (tuple[int, int]): Coordinates.
Returns:
float: Distance from the origin.
distance_between_points(x1, y1, x2, y2) -> float
Calculates the distance between two points.
Parameters:
x1, y1, x2, y2 (int): Coordinates of the two points.
Returns:
float: Distance between the two points.
convert_to_string(constant: int, typee: object) -> str
Converts a constant value to its string representation based on its type.
Parameters:
constant (int): The constant to convert.
typee (object): The type of the constant (e.g., BastionType, Structure, BiomeID).
Returns:
str: String representation of the constant.
get_structure_pos(structure: Structure, g: Generator, rx: int, rz: int) -> tuple[int, int]
Gets the position of a structure.
Parameters:
structure (Structure): The structure to find.
g (Generator): The generator instance.
rx, rz (int): Coordinates.
Returns:
tuple[int, int]: Coordinates of the structure or None if not found.
is_viable_structure_pos(structure: Structure, g: Generator, x: int, z: int) -> bool
Checks if a position is viable for a structure.
Parameters:
structure (Structure): The structure to check.
g (Generator): The generator instance.
x, z (int): Coordinates.
Returns:
bool: True if viable, otherwise False.
get_stronghold_pos(g: Generator, count: int) -> list[tuple[int, int]]
Gets positions of strongholds.
Parameters:
g (Generator): The generator instance.
count (int): Number of strongholds to retrieve.
Returns:
list[tuple[int, int]]: List of stronghold positions.
get_spawn_pos(g: Generator) -> tuple[int, int]
Gets the spawn position of the world.
Parameters:
g (Generator): The generator instance.
Returns:
tuple[int, int]: Spawn coordinates.
get_biome_at(g: Generator, x: int, y: int, z: int) -> BiomeID
Gets the biome at a specific coordinate.
Parameters:
g (Generator): The generator instance.
x, y, z (int): Coordinates.
Returns:
BiomeID: ID of the biome at the coordinates.
get_bastion_variant(g: Generator, x: int, z: int) -> BastionType
Gets the bastion variant at a specific coordinate.
Parameters:
g (Generator): The generator instance.
x, z (int): Coordinates.
Returns:
BastionType: Type of bastion at the coordinates.
find_structure_in_range(g: Generator, structure: Structure, srx: int, srz: int, erx: int, erz: int) -> list[tuple[int, int]]
Finds structures within a specified range.
Parameters:
g (Generator): The generator instance.
structure (Structure): The structure to find.
srx, srz, erx, erz (int): Range coordinates.
Returns:
list[tuple[int, int]]: List of structure positions or None if no structures are found.
find_closest_structure(g: Generator, structure: Structure, cx: int, cz: int, limit: int) -> tuple[int, int]
Finds the closest structure to a given coordinate.
Parameters:
g (Generator): The generator instance.
structure (Structure): The structure to find.
cx, cz (int): Coordinates.
limit (int): Maximum search distance.
Returns:
tuple[int, int]: Coordinates of the closest structure or None if not found.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cubiomespi-1.0.tar.gz
(229.1 kB
view details)
Built Distribution
cubiomespi-1.0-py3-none-any.whl
(227.5 kB
view details)
File details
Details for the file cubiomespi-1.0.tar.gz
.
File metadata
- Download URL: cubiomespi-1.0.tar.gz
- Upload date:
- Size: 229.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
07c8d20cf2a4fd80c272668b6040021926a878e189996055f7ebfe950cc63009
|
|
MD5 |
57209b577d19fe1a1837b8527d5a7a22
|
|
BLAKE2b-256 |
7f81179b3704b2bbd4a910e15618086f05a3cf57ceba97e24a4deb54f668db5c
|
File details
Details for the file cubiomespi-1.0-py3-none-any.whl
.
File metadata
- Download URL: cubiomespi-1.0-py3-none-any.whl
- Upload date:
- Size: 227.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
7c1ba0f1a26c7b3e7011721924cccbeb140a7f9172408b588b45bc99d9c48e45
|
|
MD5 |
e89e3470e52065685ded6f5b3faf6a6e
|
|
BLAKE2b-256 |
00cc4774c487c99b8337cf926b24c807c4b30b009728f61facb582ecf2bf4a71
|