SteamWar/BauSystem
Archiviert
13
0

TestblockReset #247

Manuell gemergt
YoyoNow hat 5 Commits von TestblockReset nach master 2021-04-10 20:40:58 +02:00 zusammengeführt
Nur Änderungen aus Commit fbb0cd3f4e werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -19,7 +19,6 @@
package de.steamwar.bausystem.world.regions; package de.steamwar.bausystem.world.regions;
import com.google.common.collect.Sets;
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;
@ -78,11 +77,11 @@ class Region_15 {
if (pasteOptions.isReset()) { if (pasteOptions.isReset()) {
e.setBlocks(new CuboidRegion(RegionUtils_15.toBlockVector3(pasteOptions.getMinPoint()), RegionUtils_15.toBlockVector3(pasteOptions.getMaxPoint())), BlockTypes.AIR.getDefaultState().toBaseBlock()); e.setBlocks(new CuboidRegion(RegionUtils_15.toBlockVector3(pasteOptions.getMinPoint()), RegionUtils_15.toBlockVector3(pasteOptions.getMaxPoint())), BlockTypes.AIR.getDefaultState().toBaseBlock());
if (pasteOptions.getWaterLevel() != 0) {
System.out.println(e.setBlocks(new CuboidRegion(RegionUtils_15.toBlockVector3(pasteOptions.getMinPoint()), RegionUtils_15.toBlockVector3(pasteOptions.getMaxPoint()).withY(pasteOptions.getWaterLevel())), BlockTypes.WATER.getDefaultState().toBaseBlock()));
}
} }
Operations.completeBlindly(ch.createPaste(e).to(v).ignoreAirBlocks(pasteOptions.isIgnoreAir()).build()); Operations.completeBlindly(ch.createPaste(e).to(v).ignoreAirBlocks(pasteOptions.isIgnoreAir()).build());
if (pasteOptions.isReset() && pasteOptions.getWaterLevel() != 0) {
System.out.println(e.replaceBlocks(new CuboidRegion(RegionUtils_15.toBlockVector3(pasteOptions.getMinPoint()), RegionUtils_15.toBlockVector3(pasteOptions.getMaxPoint()).withY(pasteOptions.getWaterLevel())), new HashSet<>(Arrays.asList(BlockTypes.AIR.getDefaultState().toBaseBlock())), BlockTypes.WATER.getDefaultState().toBaseBlock()));
}
return e; return e;
} catch (WorldEditException e) { } catch (WorldEditException e) {
throw new SecurityException(e.getMessage(), e); throw new SecurityException(e.getMessage(), e);