def perform(level, box, options): surface = Surface(box.minx, box.minz, box.maxx, box.maxz) calculateHeightMapAdv(level, surface) xStart = 2 zStart = 2 xEnd = surface.xLength - 3 zEnd = surface.zLength - 3 x = xStart z = zStart y = 90 xChange = 1 if xStart > xEnd: xChange = -1 zChange = 1 if zStart > zEnd: zChange = -1 angle1 = math.atan2(zEnd - z, xEnd - x) angle2 = math.pi angleDif = math.pi - abs(abs(angle1 - angle2) - math.pi) print("a1: " + str(angle1) + ", a2: " + str(angle2) + ", dif: " + str(angleDif)) #while x != xEnd and z != zEnd: # angle = math.atan2(zEnd - z, xEnd - x) #setBlock(level, surface, xEnd, y, zEnd, 57)
def perform(level, box, options): surface = Surface(box.minx, box.minz, box.maxx, box.maxz) calculateHeightMapAdv(level, surface) calculateSteepnessMap(surface) calculateWaterPlacement(level, surface) sections = calculateSections(surface, 1, 40) allPoints = [] for section in sections: if section.isWater: continue for point in section.points: allPoints.append(point) length = len(allPoints) houseId = 0 for s in range(100): i = randint(0, length - 1) x = allPoints[i].x z = allPoints[i].z rec = getRectangle(surface, x, z, 1) if not isValidRectangle(rec): continue registerAsOccupied(surface, rec) registerHouse(surface, rec, houseId) houseId += 1 createPyramid(level, rec.xStart + 2 + box.minx, rec.xEnd - 2 + box.minx, rec.zStart + 2 + box.minz, rec.zEnd - 2 + box.minz, surface.surfaceMap[x][z].height) simpleSurface = SimpleSurface(box.minx, box.minz, box.maxx, box.maxz) calculateAttributes(simpleSurface, surface) printAttributes(simpleSurface)
def perform(level, box, options): surface = Surface(box.minx, box.minz, box.maxx, box.maxz) calculateHeightMapAdv(level, surface) calculateSteepnessMap(surface) for x in range(surface.xLength): for z in range(surface.zLength): placeHeightBlocks(level, surface, x, z)
def perform(level, box, options): surface = Surface(box.minx, box.minz, box.maxx, box.maxz) calculateHeightMapAdv(level, surface) calculateSteepnessMap(surface) calculateWaterPlacement(level, surface) calculateBiomeMap(level, surface) sections = calculateSections(surface, 1, 15) calculateSectionMids(surface, sections) smallLandSections = [] mediumLandSections = [] bigLandSections = [] waterSections = [] arrangeSections(sections, waterSections, bigLandSections, mediumLandSections, smallLandSections) paintSections(level, surface, smallLandSections, mediumLandSections, bigLandSections, waterSections) averageSurfaceHeight = calculateAverageSurfaceHeight(surface) calculateAverageSectionHeights(surface, sections) towerSections = getTowerSections(surface, averageSurfaceHeight, bigLandSections, mediumLandSections, smallLandSections) habitatSections = getHabitatSections(towerSections, mediumLandSections, bigLandSections) paths = getPathsInSections(surface, bigLandSections) paintPathPoints(level, surface, habitatSections) paintPaths(level, surface, paths, (35, 8)) intersectionPaths = getPathsBetweenSections(surface, habitatSections) paths.extend(intersectionPaths) buildPaths(level, surface, paths) paintPaths(level, surface, intersectionPaths, (35, 2)) houseProperties = getHouseProperties(surface, paths) farmProperties = getFarmProperties(surface, paths) paintTowerProperties(level, surface, towerSections) paintHouseProperties(level, surface, houseProperties) paintFarmProperties(level, surface, farmProperties)
def perform(level, box, options): surface = Surface(box.minx, box.minz, box.maxx, box.maxz) calculateHeightMapAdv(level, surface) calculateSteepnessMap(surface) calculateWaterPlacement(level, surface) sections = calculateSections(surface, 1, 15) calculateSectionMids(surface, sections) smallLandSections = [] mediumLandSections = [] bigLandSections = [] waterSections = [] arrangeSections(sections, waterSections, bigLandSections, mediumLandSections, smallLandSections) paintSections(level, surface, smallLandSections, mediumLandSections, bigLandSections, waterSections)
def perform(level, box, options): surface = Surface(box.minx, box.minz, box.maxx, box.maxz) calculateHeightMapAdv(level, surface) calculateSteepnessMap(surface) calculateWaterPlacement(level, surface) sections = calculateSections(surface, 1, 15) for section in sections: calculateSectionMid(surface, section) for x in range(surface.xLength): for z in range(surface.zLength): layer = surface.surfaceMap[x][z].layer # block = layerBlocks[min([layer + 1, len(layerBlocks) - 1])] block = layerBlocks[(layer + 1) % len(layerBlocks)] if surface.surfaceMap[x][z].isWater or surface.surfaceMap[x][ z].sectionId == -1: block = (35, 15) setBlock(level, surface, x, 249, z, 2, 0) setBlock(level, surface, x, 250, z, block)