SteamWar/BauSystem2.0
Archiviert
12
0

Merge pull request 'Fix rg color in 1.18' (#89) from fixRgColor into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #89
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
YoyoNow 2022-05-18 20:53:53 +02:00
Commit 6f45745f79

Datei anzeigen

@ -30,13 +30,14 @@ import com.sk89q.worldedit.extent.clipboard.io.BuiltInClipboardFormat;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter;
import com.sk89q.worldedit.function.mask.AbstractExtentMask;
import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.function.mask.Mask2D;
import com.sk89q.worldedit.function.operation.ForwardExtentCopy;
import com.sk89q.worldedit.function.operation.Operations;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.transform.AffineTransform;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.regions.selector.CuboidRegionSelector;
import com.sk89q.worldedit.session.ClipboardHolder;
import com.sk89q.worldedit.world.World;
@ -167,10 +168,10 @@ public class FlatteningWrapper15 implements FlatteningWrapper.IFlatteningWrapper
blocks.add("minecraft:" + pasteOptions.getColor().name().toLowerCase() + "_concrete_powder");
blocks.add("minecraft:" + pasteOptions.getColor().name().toLowerCase() + "_carpet");
e.setMask(new AbstractExtentMask(clipboard) {
e.setMask(new Mask() {
@Override
public boolean test(BlockVector3 blockVector3) {
BaseBlock block = getExtent().getFullBlock(blockVector3);
BaseBlock block = clipboard.getFullBlock(blockVector3);
String blockName = block.toString().toLowerCase();
return blocks.contains(blockName);
}
@ -180,6 +181,10 @@ public class FlatteningWrapper15 implements FlatteningWrapper.IFlatteningWrapper
public Mask2D toMask2D() {
return null;
}
public Mask copy() {
return this;
}
});
}
System.out.println("ChangeColor: " + stop("changeColor"));
@ -199,9 +204,9 @@ public class FlatteningWrapper15 implements FlatteningWrapper.IFlatteningWrapper
start("reset");
if (pasteOptions.isReset()) {
e.setBlocks(new CuboidRegion(toBlockVector3(pasteOptions.getMinPoint()), toBlockVector3(pasteOptions.getMaxPoint())), Objects.requireNonNull(BlockTypes.AIR).getDefaultState().toBaseBlock());
e.setBlocks((Region) new CuboidRegion(toBlockVector3(pasteOptions.getMinPoint()), toBlockVector3(pasteOptions.getMaxPoint())), Objects.requireNonNull(BlockTypes.AIR).getDefaultState().toBaseBlock());
if (pasteOptions.getWaterLevel() != 0) {
e.setBlocks(new CuboidRegion(toBlockVector3(pasteOptions.getMinPoint()), toBlockVector3(pasteOptions.getMaxPoint()).withY(pasteOptions.getWaterLevel())), Objects.requireNonNull(BlockTypes.WATER).getDefaultState().toBaseBlock());
e.setBlocks((Region) new CuboidRegion(toBlockVector3(pasteOptions.getMinPoint()), toBlockVector3(pasteOptions.getMaxPoint()).withY(pasteOptions.getWaterLevel())), Objects.requireNonNull(BlockTypes.WATER).getDefaultState().toBaseBlock());
}
}
System.out.println("Reset: " + stop("reset"));