-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
41 lines (33 loc) · 1.05 KB
/
main.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
from json import load
from random import randint
import os
from randomizer.randBiomes import biomes_main
from randomizer.randDims import dims_main
from randomizer.randNoise import noise_main
from randomizer.randSurfaces import surfaces_main
def load_data():
base_dir = "data"
data = {}
for filename in os.listdir(base_dir):
with open(os.path.join(base_dir, filename)) as f:
data[filename.split(".")[0]] = load(f)
return data
def load_config():
with open("config.json") as f:
config = load(f)
config["output"] = os.path.join("Compiled datapacks",
"random_dimensions", "data")
if config["seed"] == -1:
config["seed"] = randint(-2e10, 2e10)
return config
def main():
config = load_config()
data = load_data()
surfaces_main(config, data)
biomes_main(config, data)
noise_main(config, data)
dims_main(config, data)
if __name__ == "__main__":
print("** Starting Randomization **")
main()
print("** Completed! **")