SteamWar/BauSystem
Archiviert
13
0

Fix Region_15.changeColor #241

Manuell gemergt
YoyoNow hat 2 Commits von FixTestblock nach master 2021-04-09 16:07:40 +02:00 zusammengeführt
Nur Änderungen aus Commit b9aa99b52c werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -30,6 +30,7 @@ import com.sk89q.worldedit.function.operation.Operations;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.transform.AffineTransform;
import com.sk89q.worldedit.session.ClipboardHolder;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes;
import java.io.File;
@ -84,17 +85,18 @@ class Region_15 {
for (int y = 0; y < clipboard.getDimensions().getY(); y++) {
for (int z = 0; z < clipboard.getDimensions().getZ(); z++) {
BlockVector3 blockPointer = clipboard.getMinimumPoint().add(x, y, z);
clipboard.setBlock(blockPointer, mapColor(clipboard.getFullBlock(blockPointer).getBlockType(), color).getDefaultState().toBaseBlock());
BaseBlock baseBlock = clipboard.getFullBlock(blockPointer);
BlockType blockType = baseBlock.getBlockType();
if (blockType != BlockTypes.YELLOW_CONCRETE && blockType != BlockTypes.YELLOW_STAINED_GLASS) {
continue;
}
clipboard.setBlock(blockPointer, mapColor(blockType, color).getDefaultState().toBaseBlock());
}
}
}
}
private static BlockType mapColor(BlockType original, Color color) {
if (original != BlockTypes.YELLOW_CONCRETE && original != BlockTypes.YELLOW_STAINED_GLASS) {
return original;
}
switch (color) {
case WHITE:
if (original == BlockTypes.YELLOW_CONCRETE) {