SteamWar/BauSystem2.0
Archiviert
12
0

TestBlockPaste-Without-Water #146

Zusammengeführt
YoyoNow hat 25 Commits von TestBlockPaste-Without-Water nach master 2023-08-19 23:29:20 +02:00 zusammengeführt
4 geänderte Dateien mit 18 neuen und 36 gelöschten Zeilen
Nur Änderungen aus Commit 55a63dacaf werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -19,6 +19,8 @@
package de.steamwar.bausystem.utils; package de.steamwar.bausystem.utils;
import com.google.common.collect.ImmutableMap;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.WorldEditException;
@ -42,8 +44,9 @@ import com.sk89q.worldedit.regions.selector.CuboidRegionSelector;
import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.session.ClipboardHolder;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.region.Color; import de.steamwar.bausystem.region.Color;
import de.steamwar.bausystem.region.PasteOptions; import de.steamwar.bausystem.region.PasteOptions;
import de.steamwar.bausystem.region.Point; import de.steamwar.bausystem.region.Point;
@ -61,7 +64,10 @@ import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.Arrays;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import java.util.logging.Level; import java.util.logging.Level;
public class FlatteningWrapper15 implements FlatteningWrapper { public class FlatteningWrapper15 implements FlatteningWrapper {

Datei anzeigen

@ -57,7 +57,7 @@ public class TestblockCommand extends SWCommand {
Region region = regionCheck(p); Region region = regionCheck(p);
if (region == null) return; if (region == null) return;
try { try {
region.reset(RegionType.TESTBLOCK, regionExtensionType, true); region.reset(RegionType.TESTBLOCK, regionExtensionType);
RegionUtils.message(region, "REGION_TB_DONE"); RegionUtils.message(region, "REGION_TB_DONE");
} catch (IOException e) { } catch (IOException e) {
BauSystem.MESSAGE.send("REGION_TB_ERROR", p); BauSystem.MESSAGE.send("REGION_TB_ERROR", p);
@ -86,7 +86,7 @@ public class TestblockCommand extends SWCommand {
} }
try { try {
region.reset(node, RegionType.TESTBLOCK, regionExtensionType, true); region.reset(node, RegionType.TESTBLOCK, regionExtensionType);
RegionUtils.message(region, "REGION_TB_DONE"); RegionUtils.message(region, "REGION_TB_DONE");
} catch (IOException e) { } catch (IOException e) {
BauSystem.MESSAGE.send("REGION_TB_ERROR", p); BauSystem.MESSAGE.send("REGION_TB_ERROR", p);

Datei anzeigen

@ -28,44 +28,20 @@ import lombok.Getter;
@AllArgsConstructor @AllArgsConstructor
public class PasteOptions { public class PasteOptions {
/**
* Used in 1.15
*/
private final boolean rotate; private final boolean rotate;
/**
* Used in 1.15
*/
private final boolean ignoreAir; private final boolean ignoreAir;
/**
* Used in 1.15
*/
private final Color color; private final Color color;
/**
* Used in 1.15
*/
private final boolean onlyColors; private final boolean onlyColors;
/**
* Used in 1.15
*/
private final boolean reset; private final boolean reset;
/**
* Used in 1.15
*/
private final Point minPoint; private final Point minPoint;
/**
* Used in 1.15
*/
private final Point maxPoint; private final Point maxPoint;
/**
* Used in 1.15
*/
private final int waterLevel; private final int waterLevel;
private final boolean testBlock; private final boolean testBlock;

Datei anzeigen

@ -421,12 +421,12 @@ public class Region {
reset(schematic, regionType, RegionExtensionType.NORMAL, false); reset(schematic, regionType, RegionExtensionType.NORMAL, false);
} }
public void reset(RegionType regionType, RegionExtensionType regionExtensionType, boolean isTestBlock) throws IOException { public void reset(RegionType regionType, RegionExtensionType regionExtensionType) throws IOException {
reset(null, regionType, regionExtensionType, isTestBlock); reset(null, regionType, regionExtensionType);
} }
public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType, boolean isTestBlock) throws IOException { public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType) throws IOException {
reset(schematic, regionType, regionExtensionType, false, isTestBlock); reset(schematic, regionType, regionExtensionType, false);
} }
public void reset(File file) { public void reset(File file) {
@ -435,11 +435,11 @@ public class Region {
undoSessions.push(editSession); undoSessions.push(editSession);
} }
public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType, boolean ignoreAir, boolean isTestBlock) throws IOException { public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType, boolean ignoreAir) throws IOException {
reset(schematic, regionType, regionExtensionType, ignoreAir, false, isTestBlock); reset(schematic, regionType, regionExtensionType, ignoreAir, false);
} }
public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType, boolean ignoreAir, boolean onlyColors, boolean isTestBlock) throws IOException { public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType, boolean ignoreAir, boolean onlyColors) throws IOException {
if (!hasReset(regionType)) { if (!hasReset(regionType)) {
return; return;
} }
@ -447,7 +447,7 @@ public class Region {
regionExtensionType = RegionExtensionType.NORMAL; regionExtensionType = RegionExtensionType.NORMAL;
} }
PasteOptions pasteOptions = new PasteOptions((schematic != null && (schematic.getSchemtype().fightType() || schematic.getSchemtype().check())), ignoreAir, getPlain(Flag.COLOR, ColorMode.class).getColor(), onlyColors, regionExtensionType == RegionExtensionType.EXTENSION, getMinPoint(regionType, regionExtensionType), getMaxPoint(regionType, regionExtensionType), waterLevel, isTestBlock); PasteOptions pasteOptions = new PasteOptions((schematic != null && (schematic.getSchemtype().fightType() || schematic.getSchemtype().check())), ignoreAir, getPlain(Flag.COLOR, ColorMode.class).getColor(), onlyColors, regionExtensionType == RegionExtensionType.EXTENSION, getMinPoint(regionType, regionExtensionType), getMaxPoint(regionType, regionExtensionType), waterLevel, regionType == RegionType.TESTBLOCK);
Point pastePoint; Point pastePoint;
File tempFile = null; File tempFile = null;