forked from SteamWar/SteamWar
Update void world to water world
This commit is contained in:
+17
@@ -28,6 +28,7 @@ import com.sk89q.worldedit.math.transform.AffineTransform;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import de.steamwar.bausystem.region.Point;
|
||||
import de.steamwar.bausystem.region.Region;
|
||||
import de.steamwar.bausystem.utils.FlatteningWrapper;
|
||||
import de.steamwar.sql.SchematicData;
|
||||
import de.steamwar.sql.SchematicNode;
|
||||
@@ -40,7 +41,23 @@ import java.io.IOException;
|
||||
@UtilityClass
|
||||
public class PasteUtils {
|
||||
|
||||
// TODO: Create special tiles for global water reset!
|
||||
private static final VariantSelector Reset = VariantSelector.Folder("Wet");
|
||||
|
||||
public static void reset(Point minPoint, Point maxPoint) {
|
||||
if (true) {
|
||||
// TODO: Update to set Water Tile since no longer void world!
|
||||
Tile minTile = Tile.fromPoint(minPoint).orElseThrow();
|
||||
Tile maxTile = Tile.fromPoint(maxPoint).orElseThrow();
|
||||
for (int x = minTile.getTileX(); x <= maxTile.getTileX(); x++) {
|
||||
for (int z = minTile.getTileZ(); z <= maxTile.getTileZ(); z++) {
|
||||
SchematicNode node = Reset.select().orElseThrow();
|
||||
paste(node, Tile.fromTile(x, z).orElseThrow().getMinPoint().setY(Region.Area.WORLD_MIN_Y), 0);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
EditSession editSession = WorldEdit.getInstance()
|
||||
.newEditSessionBuilder()
|
||||
.world(BukkitAdapter.adapt(Bukkit.getWorlds().get(0)))
|
||||
|
||||
Reference in New Issue
Block a user