This repository was archived by the owner on Jul 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample.py
50 lines (32 loc) · 2.38 KB
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#
#simple example program
#that can find biomes and structures
import Pyubiomes
import random
from Pyubiomes import Versions, Biomes, Structures
import concurrent.futures
from Pyubiomes import structure_in_area, biomes_in_area, is_valid_structure_pos, get_spawn, get_strongholds, PyuMap
wanted=[Biomes.plains, Biomes.savanna] #program does not like it if there's only 1 argument
structure=Structures.Village
nether_biomes=[Biomes.nether_wastes, Biomes.crimson_forest, Biomes.soul_sand_valley, Biomes.warped_forest]
def finder(start, increment):
seed=0
while True:
structurecheck=structure_in_area(structure, seed, -128, -128, 128, 128, 16) #check to see if the structure is in the area
print(seed)
if structurecheck:
if is_valid_structure_pos(structure, seed, *structurecheck, 16): #check if structure can spawn
biomecheck=biomes_in_area(wanted, seed, -128, -128, 128, 128, 16) and Pyubiomes.nether_biomes_in_area(seed, nether_biomes,-128, -128, 128, 128) #check for overworld and nether biomes
if biomecheck:
print(f"found seed {seed}")
exit()
break
seed=random.randint(-2**63, 2**63-1) #generate "random" seed
def start(n):
with concurrent.futures.ThreadPoolExecutor(max_workers=n) as executor:
jobs = {executor.submit(finder, *(i,n)) for i in range(n)}
for fut in concurrent.futures.as_completed(jobs):
print(fut.result())
start(1)
PyuMap(-5332437328450840283, -16, -16, 32, 32, 4, 16, "mushroom_village").save().toPNG() #create a biome map of this cool seed I found
#Biomes.badlands, Biomes.badlands_plateau, Biomes.bamboo_jungle, Biomes.bamboo_jungle_hills, Biomes.beach, Biomes.birch_forest, Biomes.birch_forest_hills, Biomes.cold_ocean, Biomes.dark_forest, Biomes.deep_cold_ocean, Biomes.deep_lukewarm_ocean, Biomes.deep_frozen_ocean, Biomes.desert, Biomes.desert_hills, Biomes.forest, Biomes.frozen_river, Biomes.giant_tree_taiga, Biomes.giant_tree_taiga_hills, Biomes.jungle, Biomes.jungle_edge, Biomes.jungle_hills, Biomes.lukewarm_ocean, Biomes.mountains, Biomes.mushroom_field_shore, Biomes.mushroom_fields, Biomes.plains, Biomes.river, Biomes.savanna, Biomes.savanna_plateau, Biomes.snowy_beach, Biomes.snowy_mountains, Biomes.snowy_taiga, Biomes.snowy_taiga_hills, Biomes.snowy_tundra, Biomes.stone_shore, Biomes.swamp, Biomes.taiga, Biomes.taiga_hills, Biomes.warm_ocean, Biomes.wooded_badlands_plateau, Biomes.wooded_hills, Biomes.wooded_mountains