-
Notifications
You must be signed in to change notification settings - Fork 0
/
benchmarkTimeForBuilding.py
68 lines (57 loc) · 2.68 KB
/
benchmarkTimeForBuilding.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Make sure that your config/config.json -> debugMode = false
import time
milliseconds = int(round(time.time() * 1000))
from generation.resources import *
from generation.chestGeneration import *
from generation.structures.structures import *
from generation.structureManager import *
from generation.floodFill import *
import generation.resourcesLoader as resLoader
from utils.worldModification import *
import utils.argumentParser as argParser
import utils.utils as utils
import lib.interfaceUtils as iu
interface = interfaceUtils.Interface(buffering=True, caching = True)
interface.setCaching(True)
interface.setBuffering(True)
iu.setCaching(True)
iu.setBuffering(True)
worldModif = WorldModification(interface)
args, parser = argParser.giveArgsAndParser()
area = argParser.getBuildArea(args)
if area == -1:
exit()
resources = Resources()
resLoader.loadAllResources(resources)
chestGeneration = ChestGeneration(resources, interface)
structure = resources.structures["basicwindmill"]
info = structure.info
buildingCondition = BaseStructure.createBuildingCondition()
buildingInfo = structure.setupInfoAndGetCorners()
buildingCondition["flip"] = 0
buildingCondition["rotation"] = 0
buildingInfo = structure.getNextBuildingInformation( buildingCondition["flip"], buildingCondition["rotation"])
buildingCondition["size"] = buildingInfo["size"]
buildingCondition["replaceAllAir"] = 3
buildingCondition["position"] = [0, 71, 0]
structureBiomeId = utils.getBiome(buildingCondition["position"][0], buildingCondition["position"][2], 1, 1)
structureBiomeName = resources.biomeMinecraftId[int(structureBiomeId)]
structureBiomeBlockId = str(resources.biomesBlockId[structureBiomeName])
if structureBiomeBlockId == "-1" :
structureBiomeBlockId = "0"
# Load block for structure biome
for aProperty in resources.biomesBlocks[structureBiomeBlockId]:
if aProperty in resources.biomesBlocks["rules"]["village"]:
buildingCondition["replacements"][aProperty] = resources.biomesBlocks[structureBiomeBlockId][aProperty]
# Load block for structure biome
for aProperty in resources.biomesBlocks[structureBiomeBlockId]:
if aProperty in resources.biomesBlocks["rules"]["structure"]:
buildingCondition["replacements"][aProperty] = resources.biomesBlocks[structureBiomeBlockId][aProperty]
for i in range(200):
buildingCondition["referencePoint"] = buildingInfo["entry"]["position"]
buildingCondition["position"] = [ - 150 + 20 * (int(i / 10)), 5, - 150 + 20 * (int(i % 10))]
print(str(i) + " : " + str(buildingCondition["position"]))
structure.build(worldModif, buildingCondition, chestGeneration)
milliseconds2 = int(round(time.time() * 1000))
result = milliseconds2 - milliseconds
print(result / 1000)