https://github.com/scriptlinestudios/pybiomes
Python bindings for cubiomes
https://github.com/scriptlinestudios/pybiomes
Last synced: 5 months ago
JSON representation
Python bindings for cubiomes
- Host: GitHub
- URL: https://github.com/scriptlinestudios/pybiomes
- Owner: ScriptLineStudios
- License: mit
- Created: 2024-12-10T20:45:25.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-01-14T12:30:43.000Z (6 months ago)
- Last Synced: 2025-01-14T13:44:13.022Z (6 months ago)
- Language: C
- Size: 286 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pybiomes
Python bindings for cubiomes (currently incomplete)# installation
Tested on Linux, but should work fine on Windows.
```bash
git clone https://github.com/ScriptLineStudios/pybiomes --recursive
pip install -e .
```# examples
Searching for mushroom islands.
```python
import pybiomesfrom pybiomes.versions import MC_1_21_1
from pybiomes.dimensions import DIM_OVERWORLDgenerator = pybiomes.Generator(MC_1_21_1, 0)
for seed in range(100000):
generator.apply_seed(seed, DIM_OVERWORLD)
biome_id = generator.get_biome_at(1, 0, 60, 0)
if biome_id == pybiomes.biomes.mushroom_fields:
print(seed)
```Searching for outposts.
```python
import pybiomesfrom pybiomes.versions import MC_1_21_1
from pybiomes.dimensions import DIM_OVERWORLDfinder = pybiomes.Finder(MC_1_21_1)
generator = pybiomes.Generator(MC_1_21_1, 0)for lower48 in range(1000000):
pos = finder.get_structure_pos(pybiomes.structures.Outpost, lower48, 0, 0)
if not pos:
continueif pos.x >= 16 or pos.z >= 16:
continuefor upper16 in range(0x10000):
seed = lower48 | (upper16 << 48)
generator.apply_seed(seed, DIM_OVERWORLD)if generator.is_viable_structure_pos(pybiomes.structures.Outpost, pos.x, pos.z, 0):
print(seed)
exit()
```