TestBlockPaste-Without-Water #146
@ -19,6 +19,8 @@
|
||||
|
||||
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.WorldEdit;
|
||||
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.world.World;
|
||||
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 de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.region.Color;
|
||||
import de.steamwar.bausystem.region.PasteOptions;
|
||||
import de.steamwar.bausystem.region.Point;
|
||||
@ -61,7 +64,10 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
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;
|
||||
|
||||
public class FlatteningWrapper15 implements FlatteningWrapper {
|
||||
|
@ -57,7 +57,7 @@ public class TestblockCommand extends SWCommand {
|
||||
Region region = regionCheck(p);
|
||||
if (region == null) return;
|
||||
try {
|
||||
region.reset(RegionType.TESTBLOCK, regionExtensionType, true);
|
||||
region.reset(RegionType.TESTBLOCK, regionExtensionType);
|
||||
RegionUtils.message(region, "REGION_TB_DONE");
|
||||
} catch (IOException e) {
|
||||
BauSystem.MESSAGE.send("REGION_TB_ERROR", p);
|
||||
@ -86,7 +86,7 @@ public class TestblockCommand extends SWCommand {
|
||||
}
|
||||
|
||||
try {
|
||||
region.reset(node, RegionType.TESTBLOCK, regionExtensionType, true);
|
||||
region.reset(node, RegionType.TESTBLOCK, regionExtensionType);
|
||||
RegionUtils.message(region, "REGION_TB_DONE");
|
||||
} catch (IOException e) {
|
||||
BauSystem.MESSAGE.send("REGION_TB_ERROR", p);
|
||||
|
@ -28,44 +28,20 @@ import lombok.Getter;
|
||||
@AllArgsConstructor
|
||||
public class PasteOptions {
|
||||
|
||||
/**
|
||||
* Used in 1.15
|
||||
*/
|
||||
private final boolean rotate;
|
||||
|
||||
/**
|
||||
* Used in 1.15
|
||||
*/
|
||||
private final boolean ignoreAir;
|
||||
|
||||
/**
|
||||
* Used in 1.15
|
||||
*/
|
||||
private final Color color;
|
||||
|
||||
/**
|
||||
* Used in 1.15
|
||||
*/
|
||||
private final boolean onlyColors;
|
||||
|
||||
/**
|
||||
* Used in 1.15
|
||||
*/
|
||||
private final boolean reset;
|
||||
|
||||
/**
|
||||
* Used in 1.15
|
||||
*/
|
||||
private final Point minPoint;
|
||||
|
||||
/**
|
||||
* Used in 1.15
|
||||
*/
|
||||
private final Point maxPoint;
|
||||
|
||||
/**
|
||||
* Used in 1.15
|
||||
*/
|
||||
private final int waterLevel;
|
||||
|
||||
private final boolean testBlock;
|
||||
|
@ -421,12 +421,12 @@ public class Region {
|
||||
reset(schematic, regionType, RegionExtensionType.NORMAL, false);
|
||||
}
|
||||
|
||||
public void reset(RegionType regionType, RegionExtensionType regionExtensionType, boolean isTestBlock) throws IOException {
|
||||
reset(null, regionType, regionExtensionType, isTestBlock);
|
||||
public void reset(RegionType regionType, RegionExtensionType regionExtensionType) throws IOException {
|
||||
reset(null, regionType, regionExtensionType);
|
||||
}
|
||||
|
||||
public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType, boolean isTestBlock) throws IOException {
|
||||
reset(schematic, regionType, regionExtensionType, false, isTestBlock);
|
||||
public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType) throws IOException {
|
||||
reset(schematic, regionType, regionExtensionType, false);
|
||||
}
|
||||
|
||||
public void reset(File file) {
|
||||
@ -435,11 +435,11 @@ public class Region {
|
||||
undoSessions.push(editSession);
|
||||
}
|
||||
|
||||
public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType, boolean ignoreAir, boolean isTestBlock) throws IOException {
|
||||
reset(schematic, regionType, regionExtensionType, ignoreAir, false, isTestBlock);
|
||||
public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType, boolean ignoreAir) throws IOException {
|
||||
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)) {
|
||||
return;
|
||||
}
|
||||
@ -447,7 +447,7 @@ public class Region {
|
||||
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;
|
||||
File tempFile = null;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren