SteamWar/BauSystem2.0
Archiviert
12
0

Add option for tnt less pasting
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed

Dieser Commit ist enthalten in:
zOnlyKroks 2023-07-27 01:08:55 +02:00
Ursprung 2f66580e60
Commit 1fe2394e01
4 geänderte Dateien mit 16 neuen und 12 gelöschten Zeilen

Datei anzeigen

@ -147,7 +147,6 @@ public class FlatteningWrapper15 implements FlatteningWrapper {
changeColor(clipboard, pasteOptions.getColor());
}
Set<String> blocks = new HashSet<>();
{
blocks.add("minecraft:" + pasteOptions.getColor().name().toLowerCase() + "_wool");
@ -174,6 +173,7 @@ public class FlatteningWrapper15 implements FlatteningWrapper {
} catch (WorldEditException ex) {
throw new RuntimeException(ex);
}
if (blockName.startsWith("minecraft:tnt")) return false;
}

Datei anzeigen

@ -57,7 +57,7 @@ public class TestblockCommand extends SWCommand {
Region region = regionCheck(p);
if (region == null) return;
try {
region.reset(RegionType.TESTBLOCK, regionExtensionType);
region.reset(RegionType.TESTBLOCK, regionExtensionType, regionExtensionType == null);
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);
region.reset(node, RegionType.TESTBLOCK, regionExtensionType,true);
RegionUtils.message(region, "REGION_TB_DONE");
} catch (IOException e) {
BauSystem.MESSAGE.send("REGION_TB_ERROR", p);
@ -101,6 +101,8 @@ public class TestblockCommand extends SWCommand {
showModeParameterTypesMap.put("-n", RegionExtensionType.NORMAL);
showModeParameterTypesMap.put("-extension", RegionExtensionType.EXTENSION);
showModeParameterTypesMap.put("-e", RegionExtensionType.EXTENSION);
showModeParameterTypesMap.put("-t", null);
showModeParameterTypesMap.put("-tnt", null);
List<String> tabCompletes = new ArrayList<>(showModeParameterTypesMap.keySet());
return SWCommandUtils.createMapper(s -> showModeParameterTypesMap.getOrDefault(s, null), s -> tabCompletes);

Datei anzeigen

@ -45,4 +45,6 @@ public class PasteOptions {
private final int waterLevel;
private final boolean testBlock;
private final boolean removeTNT;
}

Datei anzeigen

@ -421,25 +421,25 @@ public class Region {
reset(schematic, regionType, RegionExtensionType.NORMAL, false);
}
public void reset(RegionType regionType, RegionExtensionType regionExtensionType) throws IOException {
reset(null, regionType, regionExtensionType);
public void reset(RegionType regionType, RegionExtensionType regionExtensionType,boolean removeTNT) throws IOException {
reset(null, regionType, regionExtensionType,removeTNT);
}
public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType) throws IOException {
reset(schematic, regionType, regionExtensionType, false);
public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType,boolean removeTNT) throws IOException {
reset(schematic, regionType, regionExtensionType, false,removeTNT);
}
public void reset(File file) {
EditSession editSession = paste(file, minPoint.add(prototype.getSizeX() / 2, 0, prototype.getSizeZ() / 2), new PasteOptions(false, false, Color.YELLOW, false, false, getMinPoint(RegionType.NORMAL, RegionExtensionType.NORMAL), getMaxPoint(RegionType.NORMAL, RegionExtensionType.NORMAL), waterLevel, false));
EditSession editSession = paste(file, minPoint.add(prototype.getSizeX() / 2, 0, prototype.getSizeZ() / 2), new PasteOptions(false, false, Color.YELLOW, false, false, getMinPoint(RegionType.NORMAL, RegionExtensionType.NORMAL), getMaxPoint(RegionType.NORMAL, RegionExtensionType.NORMAL), waterLevel, false,false));
initSessions();
undoSessions.push(editSession);
}
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 removeTNT) throws IOException {
reset(schematic, regionType, regionExtensionType, ignoreAir, false,removeTNT);
}
public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType, boolean ignoreAir, boolean onlyColors) throws IOException {
public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType, boolean ignoreAir, boolean onlyColors,boolean removeTNT) 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, regionType == RegionType.TESTBLOCK);
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,removeTNT);
Point pastePoint;
File tempFile = null;