Permalink
Browse files

Mask block id

  • Loading branch information...
boy0001 authored and me4502 committed Aug 14, 2018
1 parent 38fedfd commit be26156adf806c0fb34b486595e9ced36b1a1c72
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/main/java/com/sk89q/craftbook/mechanics/area/FlatCuboidCopy.java
@@ -153,7 +153,7 @@ public void copy() {
int[] datas =
LegacyMapper.getInstance().getLegacyFromBlock(BukkitAdapter.adapt(world.getBlockAt(BukkitAdapter.adapt(world, origin.add(x, y, z))).getBlockData()));
if (datas != null) {
if (datas[0] > Byte.MAX_VALUE) {
if (datas[0] > 255) {
// If the format doesn't support it, it's stone.
datas[0] = 1;
datas[1] = 0;
@@ -199,7 +199,7 @@ public void paste() {
for (Tuple2<Vector, byte[]> entry : queueAfter) {
byte[] v = entry.b;
BlockState state = LegacyMapper.getInstance().getBlockFromLegacy(v[0], v[1]);
BlockState state = LegacyMapper.getInstance().getBlockFromLegacy(v[0] & 0xFF, v[1]);
if (state != null) {
BlockData blockData = BukkitAdapter.adapt(state);
world.getBlockAt(entry.a.getBlockX(), entry.a.getBlockY(), entry.a.getBlockZ()).setBlockData(blockData);
@@ -208,12 +208,12 @@ public void paste() {
for (Tuple2<Vector, byte[]> entry : queueLast) {
byte[] v = entry.b;
BlockState state = LegacyMapper.getInstance().getBlockFromLegacy(v[0], v[1]);
BlockState state = LegacyMapper.getInstance().getBlockFromLegacy(v[0] & 0xFF, v[1]);
if (state != null) {
BlockData blockData = BukkitAdapter.adapt(state);
world.getBlockAt(entry.a.getBlockX(), entry.a.getBlockY(), entry.a.getBlockZ()).setBlockData(blockData);
}
}
}
}
}

0 comments on commit be26156

Please sign in to comment.