Skip to main content

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

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cubimespi-1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cubimespi-1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file cubimespi-1.0.tar.gz.

File metadata

  • Download URL: cubimespi-1.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for cubimespi-1.0.tar.gz
Algorithm Hash digest
SHA256 2d2fe4450983766c09a666179a25aeaedfa6e1cf5c28fe1ec607d363c4d6c32e
MD5 ae40ad3fc79095a2867daa43447e6b9b
BLAKE2b-256 2b3340a25faddfe46aed2fa9722d9bb2eb40b6600104e2f4ae336f666643ff0c

See more details on using hashes here.

File details

Details for the file cubimespi-1.0-py3-none-any.whl.

File metadata

  • Download URL: cubimespi-1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for cubimespi-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02da6c7d3025225453a4d6e5298a65cfb8eb881abf674b8945d48bb2a60b6f0b
MD5 d2dcb399ccc2ca1e97b278268c72d7f0
BLAKE2b-256 dbfc151e5b82fbdf7ddff5f4454c1fd9fae1f6b7ce282d29d6df5c22eb3e512b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page