CONFIG
All checks were successful
Linux arm64 / Build (push) Successful in 1m3s

This commit is contained in:
2024-10-02 16:56:38 +02:00
parent cf85af9a77
commit 5d856dc66b
11 changed files with 29 additions and 17 deletions

View File

@@ -196,7 +196,7 @@ class Skeleton:
image: 2D path of the skeleton on top of the heightmap.
"""
print("[Skeleton] Start mapping the skeleton...")
# editor = Editor()
# editor = Editor(config)
# buildArea = editor.getBuildArea()
# buildRect = buildArea.toRect()

View File

@@ -2,6 +2,7 @@ from gdpc import Editor, geometry, lookup
import numpy as np
from PIL import Image
from world_maker.Block import Block
import config
waterBiomes = [
"minecraft:ocean",
@@ -26,7 +27,8 @@ waterBlocks = [
class World:
def __init__(self):
editor = Editor(buffering=True)
editor = Editor(host=config.getHost(), buffering=True)
print("Host : ", config.getHost())
buildArea = editor.getBuildArea()
self.coordinates_min = [
@@ -72,7 +74,7 @@ class World:
Use already created volume to get block data.
"""
editor = Editor(buffering=True)
editor = Editor(host=config.getHost(), buffering=True)
if self.volume[coordinates[0] - self.coordinates_min[0]][coordinates[1] - self.coordinates_min[1]][
coordinates[2] - self.coordinates_min[2]] == None:
self.volume[coordinates[0] - self.coordinates_min[0]][coordinates[1] - self.coordinates_min[1]][
@@ -99,7 +101,7 @@ class World:
Scan the world with no optimization. Not tested on large areas.
"""
editor = Editor(buffering=True)
editor = Editor(host=config.getHost(), buffering=True)
for x in range(self.coordinates_min[0], self.coordinates_max[0] + 1):
for y in range(self.coordinates_min[1], self.coordinates_max[1] + 1):
@@ -112,7 +114,7 @@ class World:
Generate all needed datas for the generator : heightmap, watermap, and preset the volume with data from the heightmap.
"""
editor = Editor()
editor = Editor(host=config.getHost())
buildArea = editor.getBuildArea()
buildRect = buildArea.toRect()
@@ -179,7 +181,7 @@ class World:
def propagate(self, coordinates, scanned=[]):
i = 0
editor = Editor(buffering=True)
editor = Editor(host=config.getHost(), buffering=True)
if self.isInVolume(coordinates):
Block = self.getBlockFromCoordinates(coordinates)
self.getNeighbors(Block)
@@ -212,7 +214,7 @@ class World:
Args:
mask (image): white or black image : combined watermap smoothed and sobel smoothed.
"""
editor = Editor()
editor = Editor(host=config.getHost())
buildArea = editor.getBuildArea()
buildRect = buildArea.toRect()

View File

@@ -5,13 +5,14 @@ from gdpc import Editor, Block, geometry, lookup
from PIL import Image as img
from PIL.Image import Image
from skimage import morphology
import config
from world_maker.data_analysis import handle_import_image
def remove_trees(heightmap: Union[str, Image], treesmap: Union[str, Image], mask: Union[str, Image]):
print("[Remove tree] Starting...")
editor = Editor(buffering=True)
editor = Editor(host=config.getHost(), buffering=True)
build_area = editor.getBuildArea()
build_rectangle = build_area.toRect()
@@ -44,7 +45,7 @@ def remove_trees(heightmap: Union[str, Image], treesmap: Union[str, Image], mask
def smooth_terrain(heightmap: Union[str, Image], heightmap_smooth: Union[str, Image], mask: Union[str, Image]):
print("[Smooth terrain] Starting...")
editor = Editor(buffering=True)
editor = Editor(host=config.getHost(), buffering=True)
build_area = editor.getBuildArea()
build_rectangle = build_area.toRect()