From 1b73723c98b74e13c2a4d1187657794c7f34ad92 Mon Sep 17 00:00:00 2001 From: HydrolienF Date: Mon, 18 Aug 2025 13:44:59 +0200 Subject: [PATCH] withVoidBelowLevel --- .../worldpainter/tools/scripts/ImportHeightMapOp.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/WorldPainter/WPCore/src/main/java/org/pepsoft/worldpainter/tools/scripts/ImportHeightMapOp.java b/WorldPainter/WPCore/src/main/java/org/pepsoft/worldpainter/tools/scripts/ImportHeightMapOp.java index d70de082c..df15aec1c 100644 --- a/WorldPainter/WPCore/src/main/java/org/pepsoft/worldpainter/tools/scripts/ImportHeightMapOp.java +++ b/WorldPainter/WPCore/src/main/java/org/pepsoft/worldpainter/tools/scripts/ImportHeightMapOp.java @@ -104,6 +104,11 @@ public ImportHeightMapOp withUpperBuildLimit(int upperBuildLimit) { return this; } + public ImportHeightMapOp withVoidBelowLevel(int voidBelowLevel) { + this.voidBelowLevel = voidBelowLevel; + return this; + } + @Override public World2 go() throws ScriptException { goCalled(); @@ -164,6 +169,10 @@ public World2 go() throws ScriptException { } importer.setMinHeight(minHeight); importer.setMaxHeight(maxHeight); + if(voidBelowLevel != Integer.MIN_VALUE) { + importer.setVoidBelowLevel(voidBelowLevel); + importer.setVoidBelow(true); + } HeightMapTileFactory tileFactory = TileFactoryFactory.createNoiseTileFactory(new Random().nextLong(), Terrain.GRASS, minHeight, maxHeight, 58, waterLevel, false, true, 20, 1.0); Theme defaults = Configuration.getInstance().getHeightMapDefaultTheme(); @@ -189,6 +198,6 @@ public World2 go() throws ScriptException { private final HeightMapImporter importer = new HeightMapImporter(); private BitmapHeightMap heightMap; private boolean fromLevelsSpecified, toLevelsSpecified; - private int scale = 100, waterLevel = DEFAULT_WATER_LEVEL, offsetX, offsetY, lowerBuildLimit = Integer.MIN_VALUE, upperBuildLimit = Integer.MAX_VALUE; + private int scale = 100, waterLevel = DEFAULT_WATER_LEVEL, offsetX, offsetY, lowerBuildLimit = Integer.MIN_VALUE, upperBuildLimit = Integer.MAX_VALUE, voidBelowLevel = Integer.MIN_VALUE; private Platform platform = Configuration.getInstance().getDefaultPlatform(); } \ No newline at end of file