SteamWar/BauSystem2.0
Archiviert
12
0

Fix rg color in 1.18 #89

Zusammengeführt
YoyoNow hat 1 Commits von fixRgColor nach master 2022-05-18 20:53:54 +02:00 zusammengeführt

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.ClipboardFormats;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader; import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter; 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.mask.Mask2D;
import com.sk89q.worldedit.function.operation.ForwardExtentCopy; import com.sk89q.worldedit.function.operation.ForwardExtentCopy;
import com.sk89q.worldedit.function.operation.Operations; import com.sk89q.worldedit.function.operation.Operations;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.transform.AffineTransform; import com.sk89q.worldedit.math.transform.AffineTransform;
import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.regions.selector.CuboidRegionSelector; 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;
@ -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() + "_concrete_powder");
blocks.add("minecraft:" + pasteOptions.getColor().name().toLowerCase() + "_carpet"); blocks.add("minecraft:" + pasteOptions.getColor().name().toLowerCase() + "_carpet");
e.setMask(new AbstractExtentMask(clipboard) { e.setMask(new Mask() {
@Override @Override
public boolean test(BlockVector3 blockVector3) { public boolean test(BlockVector3 blockVector3) {
BaseBlock block = getExtent().getFullBlock(blockVector3); BaseBlock block = clipboard.getFullBlock(blockVector3);
String blockName = block.toString().toLowerCase(); String blockName = block.toString().toLowerCase();
return blocks.contains(blockName); return blocks.contains(blockName);
} }
@ -180,6 +181,10 @@ public class FlatteningWrapper15 implements FlatteningWrapper.IFlatteningWrapper
public Mask2D toMask2D() { public Mask2D toMask2D() {
return null; return null;
} }
public Mask copy() {
return this;
}
}); });
} }
System.out.println("ChangeColor: " + stop("changeColor")); System.out.println("ChangeColor: " + stop("changeColor"));
@ -199,9 +204,9 @@ public class FlatteningWrapper15 implements FlatteningWrapper.IFlatteningWrapper
start("reset"); start("reset");
if (pasteOptions.isReset()) { 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) { 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")); System.out.println("Reset: " + stop("reset"));