Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scriptlinestudios/pybiomes
Python bindings for cubiomes
https://github.com/scriptlinestudios/pybiomes
Last synced: 10 days 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 (24 days ago)
- Default Branch: main
- Last Pushed: 2024-12-10T20:59:01.000Z (24 days ago)
- Last Synced: 2024-12-10T21:36:04.090Z (24 days ago)
- Language: C
- Size: 0 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pybiomes
Python bindings for cubiomes# 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()
```