SteamWar/BauSystem
Archiviert
13
0

Fix Region_15.changeColor

Dieser Commit ist enthalten in:
yoyosource 2021-04-09 15:44:54 +02:00
Ursprung 8c190bf88b
Commit b9aa99b52c

Datei anzeigen

@ -30,6 +30,7 @@ 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.session.ClipboardHolder; 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.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
import java.io.File; import java.io.File;
@ -84,17 +85,18 @@ class Region_15 {
for (int y = 0; y < clipboard.getDimensions().getY(); y++) { for (int y = 0; y < clipboard.getDimensions().getY(); y++) {
for (int z = 0; z < clipboard.getDimensions().getZ(); z++) { for (int z = 0; z < clipboard.getDimensions().getZ(); z++) {
BlockVector3 blockPointer = clipboard.getMinimumPoint().add(x, y, 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) { private static BlockType mapColor(BlockType original, Color color) {
if (original != BlockTypes.YELLOW_CONCRETE && original != BlockTypes.YELLOW_STAINED_GLASS) {
return original;
}
switch (color) { switch (color) {
case WHITE: case WHITE:
if (original == BlockTypes.YELLOW_CONCRETE) { if (original == BlockTypes.YELLOW_CONCRETE) {