From a3cb8af95d4d08a2d13396e3f4724d634b6d06e8 Mon Sep 17 00:00:00 2001 From: Dominik Renzel Date: Sun, 22 Sep 2019 23:19:42 +0200 Subject: [PATCH] Revert "Added support for command blocks in Nukkit." This reverts commit ba9aff2a8a2970552d12e73791dacb5231be7c50. --- .../main/java/com/boydti/fawe/FaweCache.java | 1189 ++++++++--------- .../boydti/fawe/example/CharFaweChunk.java | 5 +- .../com/boydti/fawe/object/FaweChunk.java | 35 +- .../object/extent/FastWorldEditExtent.java | 555 ++++---- .../com/sk89q/worldedit/CuboidClipboard.java | 4 +- .../world/registry/BundledBlockData.java | 7 - 6 files changed, 893 insertions(+), 902 deletions(-) diff --git a/core/src/main/java/com/boydti/fawe/FaweCache.java b/core/src/main/java/com/boydti/fawe/FaweCache.java index c016c367..2f6eb6b2 100644 --- a/core/src/main/java/com/boydti/fawe/FaweCache.java +++ b/core/src/main/java/com/boydti/fawe/FaweCache.java @@ -150,34 +150,31 @@ public class FaweCache { static { for (int i = 0; i < Character.MAX_VALUE; i++) { int id = i >> 4; - int data = i & 0xf; - if (FaweCache.hasNBT(id)) { - if (id == 137 || id == 188 || id == 189){ - System.out.println("Has NBT: " + id + " Data: " + data); + int data = i & 0xf; + if (FaweCache.hasNBT(id)) { + CACHE_BLOCK[i] = new ImmutableNBTBlock(id, data); + } else if (FaweCache.hasData(id)) { + CACHE_BLOCK[i] = new ImmutableBlock(id, data); + } else { + CACHE_BLOCK[i] = new ImmutableDatalessBlock(id); } - CACHE_BLOCK[i] = new ImmutableNBTBlock(id, data); - } else if (FaweCache.hasData(id)) { - CACHE_BLOCK[i] = new ImmutableBlock(id, data); - } else { - CACHE_BLOCK[i] = new ImmutableDatalessBlock(id); - } - CACHE_ITEM[i] = new BaseItem(id, (short) data) { + CACHE_ITEM[i] = new BaseItem(id, (short) data) { - @Override - public void setData(short data) { - throw new IllegalStateException("Cannot set data"); - } + @Override + public void setData(short data) { + throw new IllegalStateException("Cannot set data"); + } - @Override - public void setDamage(short data) { - throw new IllegalStateException("Cannot set data"); - } + @Override + public void setDamage(short data) { + throw new IllegalStateException("Cannot set data"); + } - @Override - public void setType(int id) { - throw new IllegalStateException("Cannot set id"); - } - }; + @Override + public void setType(int id) { + throw new IllegalStateException("Cannot set id"); + } + }; } for (int i = 0; i < 256; i++) { CACHE_BIOME[i] = new BaseBiome(i) { @@ -205,18 +202,18 @@ public class FaweCache { bundled.loadFromResource(); for (int i = 0; i < Character.MAX_VALUE; i++) { int id = i >> 4; - int data = i & 0xf; - CACHE_TRANSLUSCENT[i] = BlockType.isTranslucent(id); - CACHE_PASSTHROUGH[i] = BlockType.canPassThrough(id, data); - BundledBlockData.BlockEntry blockEntry = bundled.findById(id); - if (blockEntry != null) { - BundledBlockData.FaweBlockMaterial material = blockEntry.material; - if (material != null) { - CACHE_TRANSLUSCENT[i] = !material.isOpaque(); - CACHE_PASSTHROUGH[i] = !material.isMovementBlocker(); + int data = i & 0xf; + CACHE_TRANSLUSCENT[i] = BlockType.isTranslucent(id); + CACHE_PASSTHROUGH[i] = BlockType.canPassThrough(id, data); + BundledBlockData.BlockEntry blockEntry = bundled.findById(id); + if (blockEntry != null) { + BundledBlockData.FaweBlockMaterial material = blockEntry.material; + if (material != null) { + CACHE_TRANSLUSCENT[i] = !material.isOpaque(); + CACHE_PASSTHROUGH[i] = !material.isMovementBlocker(); + } } } - } } catch (Throwable ignore) { ignore.printStackTrace(); } @@ -304,121 +301,121 @@ public class FaweCache { public static boolean isLiquidOrGas(int id) { switch (id) { - case 0: - case 8: - case 9: - case 10: - case 11: - return true; - default: - return false; + case 0: + case 8: + case 9: + case 10: + case 11: + return true; + default: + return false; } } public static boolean isLiquid(int id) { switch (id) { - case 8: - case 9: - case 10: - case 11: - return true; - default: - return false; + case 8: + case 9: + case 10: + case 11: + return true; + default: + return false; } } public static LightType getLight(int id) { switch (id) { // Lighting - case 0: - case 6: - case 27: - case 28: - case 31: - case 32: - case 37: - case 38: - case 55: - case 59: - case 65: - case 66: - case 69: - case 75: - case 77: - case 78: - case 83: - case 90: - case 93: - case 94: - case 104: - case 105: - case 106: - case 111: - case 115: - case 119: - case 127: - case 131: - case 132: - case 140: - case 141: - case 142: - case 143: - case 144: - case 149: - case 150: - case 157: - case 171: - case 175: - case 198: - case 199: - case 200: - case 207: - case 209: - case 217: - return LightType.TRANSPARENT; - case 39: - case 40: - case 50: - case 51: - case 76: - return LightType.TRANSPARENT_EMIT; - case 10: - case 11: - case 62: - case 74: - case 89: - case 122: - case 124: - case 130: - case 138: - case 169: - case 213: - return LightType.SOLID_EMIT; - default: - return LightType.OCCLUDING; + case 0: + case 6: + case 27: + case 28: + case 31: + case 32: + case 37: + case 38: + case 55: + case 59: + case 65: + case 66: + case 69: + case 75: + case 77: + case 78: + case 83: + case 90: + case 93: + case 94: + case 104: + case 105: + case 106: + case 111: + case 115: + case 119: + case 127: + case 131: + case 132: + case 140: + case 141: + case 142: + case 143: + case 144: + case 149: + case 150: + case 157: + case 171: + case 175: + case 198: + case 199: + case 200: + case 207: + case 209: + case 217: + return LightType.TRANSPARENT; + case 39: + case 40: + case 50: + case 51: + case 76: + return LightType.TRANSPARENT_EMIT; + case 10: + case 11: + case 62: + case 74: + case 89: + case 122: + case 124: + case 130: + case 138: + case 169: + case 213: + return LightType.SOLID_EMIT; + default: + return LightType.OCCLUDING; } } public static boolean hasLight(int id) { switch (id) { - case 39: - case 40: - case 50: - case 51: - case 76: - case 10: - case 11: - case 62: - case 74: - case 89: - case 122: - case 124: - case 130: - case 138: - case 169: - case 213: - return true; - default: - return false; + case 39: + case 40: + case 50: + case 51: + case 76: + case 10: + case 11: + case 62: + case 74: + case 89: + case 122: + case 124: + case 130: + case 138: + case 169: + case 213: + return true; + default: + return false; } } @@ -428,146 +425,148 @@ public class FaweCache { public static boolean isTransparent(int id) { switch (id) { - case 0: - case 6: - case 8: - case 9: - case 10: - case 11: - case 18: - case 20: - case 26: - case 27: - case 28: - case 29: - case 30: - case 31: - case 32: - case 33: - case 34: - case 36: - case 37: - case 38: - case 39: - case 40: - case 44: - case 46: - case 50: - case 51: - case 53: - case 54: - case 55: - case 59: - case 60: - case 63: - case 64: - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 75: - case 76: - case 77: - case 78: - case 79: - case 81: - case 83: - case 85: - case 89: - case 90: - case 92: - case 93: - case 94: - case 95: - case 96: - case 101: - case 102: - case 104: - case 105: - case 106: - case 107: - case 108: - case 109: - case 111: - case 113: - case 114: - case 115: - case 116: - case 117: - case 118: - case 119: - case 120: - case 122: - case 126: - case 127: - case 128: - case 130: - case 131: - case 132: - case 134: - case 135: - case 136: - case 138: - case 139: - case 140: - case 141: - case 142: - case 143: - case 144: - case 145: - case 146: - case 147: - case 148: - case 149: - case 150: - case 151: - case 152: - case 154: - case 156: - case 157: - case 160: - case 161: - case 163: - case 164: - case 167: - case 169: - case 171: - case 175: - case 176: - case 177: - case 178: - case 180: - case 182: - case 183: - case 184: - case 185: - case 186: - case 187: - case 190: - case 191: - case 192: - case 193: - case 194: - case 195: - case 196: - case 197: - case 198: - case 199: - case 200: - case 203: - case 205: - case 207: - case 208: - case 209: - case 212: - case 217: - return true; - default: - return false; + case 0: + case 6: + case 8: + case 9: + case 10: + case 11: + case 18: + case 20: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 36: + case 37: + case 38: + case 39: + case 40: + case 44: + case 46: + case 50: + case 51: + case 53: + case 54: + case 55: + case 59: + case 60: + case 63: + case 64: + case 65: + case 66: + case 67: + case 68: + case 69: + case 70: + case 71: + case 72: + case 75: + case 76: + case 77: + case 78: + case 79: + case 81: + case 83: + case 85: + case 89: + case 90: + case 92: + case 93: + case 94: + case 95: + case 96: + case 101: + case 102: + case 104: + case 105: + case 106: + case 107: + case 108: + case 109: + case 111: + case 113: + case 114: + case 115: + case 116: + case 117: + case 118: + case 119: + case 120: + case 122: + case 126: + case 127: + case 128: + case 130: + case 131: + case 132: + case 134: + case 135: + case 136: + case 138: + case 139: + case 140: + case 141: + case 142: + case 143: + case 144: + case 145: + case 146: + case 147: + case 148: + case 149: + case 150: + case 151: + case 152: + case 154: + case 156: + case 157: + case 160: + case 161: + case 163: + case 164: + case 167: + case 169: + case 171: + case 175: + case 176: + case 177: + case 178: + case 180: + case 182: + case 183: + case 184: + case 185: + case 186: + case 187: + case 188: + case 189: + case 190: + case 191: + case 192: + case 193: + case 194: + case 195: + case 196: + case 197: + case 198: + case 199: + case 200: + case 203: + case 205: + case 207: + case 208: + case 209: + case 212: + case 217: + return true; + default: + return false; } } @@ -579,68 +578,68 @@ public class FaweCache { */ public static boolean hasData(int id) { switch (id) { - case 0: - case 2: - case 4: - case 13: - case 14: - case 15: - case 20: - case 21: - case 22: - case 25: - case 30: - case 32: - case 37: - case 39: - case 40: - case 41: - case 42: - case 45: - case 46: - case 47: - case 48: - case 49: - case 51: - case 52: - case 56: - case 57: - case 58: - case 7: - case 73: - case 74: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 87: - case 88: - case 101: - case 102: - case 103: - case 110: - case 112: - case 113: - case 117: - case 121: - case 122: - case 123: - case 124: - case 129: - case 133: - case 138: - case 140: - case 165: - case 166: - case 169: - case 172: - case 173: - case 174: - return false; - default: - return true; + case 0: + case 2: + case 4: + case 13: + case 14: + case 15: + case 20: + case 21: + case 22: + case 25: + case 30: + case 32: + case 37: + case 39: + case 40: + case 41: + case 42: + case 45: + case 46: + case 47: + case 48: + case 49: + case 51: + case 52: + case 56: + case 57: + case 58: + case 7: + case 73: + case 74: + case 79: + case 80: + case 81: + case 82: + case 83: + case 84: + case 87: + case 88: + case 101: + case 102: + case 103: + case 110: + case 112: + case 113: + case 117: + case 121: + case 122: + case 123: + case 124: + case 129: + case 133: + case 138: + case 140: + case 165: + case 166: + case 169: + case 172: + case 173: + case 174: + return false; + default: + return true; } } @@ -652,265 +651,265 @@ public class FaweCache { */ public static boolean hasNBT(int id) { switch (id) { - case 26: - case 218: - case 54: - case 130: - case 142: - case 27: - case 137: - case 188: - case 189: - case 52: - case 154: - case 84: - case 25: - case 144: - case 138: - case 176: - case 177: - case 63: - case 119: - case 68: - case 323: - case 117: - case 116: - case 28: - case 66: - case 157: - case 61: - case 62: - case 140: - case 146: - case 149: - case 150: - case 158: - case 23: - case 123: - case 124: - case 29: - case 33: - case 151: - case 178: - case 209: - case 210: - case 211: - case 255: - case 219: - case 220: - case 221: - case 222: - case 223: - case 224: - case 225: - case 226: - case 227: - case 228: - case 229: - case 230: - case 231: - case 232: - case 233: - case 234: - return true; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 24: - case 30: - case 31: - case 32: - case 34: - case 35: - case 36: - case 37: - case 38: - case 39: - case 40: - case 41: - case 42: - case 43: - case 44: - case 45: - case 46: - case 47: - case 48: - case 49: - case 50: - case 51: - case 53: - case 55: - case 56: - case 57: - case 58: - case 59: - case 60: - case 64: - case 65: - case 67: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - case 91: - case 92: - case 93: - case 94: - case 95: - case 96: - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: - case 103: - case 104: - case 105: - case 106: - case 107: - case 108: - case 109: - case 110: - case 111: - case 112: - case 113: - case 114: - case 115: - case 118: - case 120: - case 121: - case 122: - case 125: - case 126: - case 127: - case 128: - case 129: - case 131: - case 132: - case 133: - case 134: - case 135: - case 136: - case 139: - case 141: - case 143: - case 145: - case 147: - case 148: - case 152: - case 153: - case 155: - case 156: - case 159: - case 160: - case 161: - case 162: - case 163: - case 164: - case 165: - case 166: - case 167: - case 168: - case 169: - case 170: - case 171: - case 172: - case 173: - case 174: - case 175: - case 179: - case 180: - case 181: - case 182: - case 183: - case 184: - case 185: - case 186: - case 187: - case 190: - case 191: - case 192: - case 193: - case 194: - case 195: - case 196: - case 197: - case 198: - case 199: - case 200: - case 201: - case 202: - case 203: - case 204: - case 205: - case 206: - case 207: - case 208: - case 212: - case 213: - case 214: - case 215: - case 216: - case 217: - case 235: - case 236: - case 237: - case 238: - case 239: - case 240: - case 241: - case 242: - case 243: - case 244: - case 245: - case 246: - case 247: - case 248: - case 249: - case 250: - case 251: - case 252: - return false; - default: - return id > 252; + case 26: + case 218: + case 54: + case 130: + case 142: + case 27: + case 137: + case 52: + case 154: + case 84: + case 25: + case 144: + case 138: + case 176: + case 177: + case 63: + case 119: + case 68: + case 323: + case 117: + case 116: + case 28: + case 66: + case 157: + case 61: + case 62: + case 140: + case 146: + case 149: + case 150: + case 158: + case 23: + case 123: + case 124: + case 29: + case 33: + case 151: + case 178: + case 209: + case 210: + case 211: + case 255: + case 219: + case 220: + case 221: + case 222: + case 223: + case 224: + case 225: + case 226: + case 227: + case 228: + case 229: + case 230: + case 231: + case 232: + case 233: + case 234: + return true; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 24: + case 30: + case 31: + case 32: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + case 51: + case 53: + case 55: + case 56: + case 57: + case 58: + case 59: + case 60: + case 64: + case 65: + case 67: + case 69: + case 70: + case 71: + case 72: + case 73: + case 74: + case 75: + case 76: + case 77: + case 78: + case 79: + case 80: + case 81: + case 82: + case 83: + case 85: + case 86: + case 87: + case 88: + case 89: + case 90: + case 91: + case 92: + case 93: + case 94: + case 95: + case 96: + case 97: + case 98: + case 99: + case 100: + case 101: + case 102: + case 103: + case 104: + case 105: + case 106: + case 107: + case 108: + case 109: + case 110: + case 111: + case 112: + case 113: + case 114: + case 115: + case 118: + case 120: + case 121: + case 122: + case 125: + case 126: + case 127: + case 128: + case 129: + case 131: + case 132: + case 133: + case 134: + case 135: + case 136: + case 139: + case 141: + case 143: + case 145: + case 147: + case 148: + case 152: + case 153: + case 155: + case 156: + case 159: + case 160: + case 161: + case 162: + case 163: + case 164: + case 165: + case 166: + case 167: + case 168: + case 169: + case 170: + case 171: + case 172: + case 173: + case 174: + case 175: + case 179: + case 180: + case 181: + case 182: + case 183: + case 184: + case 185: + case 186: + case 187: + case 188: + case 189: + case 190: + case 191: + case 192: + case 193: + case 194: + case 195: + case 196: + case 197: + case 198: + case 199: + case 200: + case 201: + case 202: + case 203: + case 204: + case 205: + case 206: + case 207: + case 208: + case 212: + case 213: + case 214: + case 215: + case 216: + case 217: + case 235: + case 236: + case 237: + case 238: + case 239: + case 240: + case 241: + case 242: + case 243: + case 244: + case 245: + case 246: + case 247: + case 248: + case 249: + case 250: + case 251: + case 252: + return false; + default: + return id > 252; } } diff --git a/core/src/main/java/com/boydti/fawe/example/CharFaweChunk.java b/core/src/main/java/com/boydti/fawe/example/CharFaweChunk.java index 95a5995b..e0eef250 100644 --- a/core/src/main/java/com/boydti/fawe/example/CharFaweChunk.java +++ b/core/src/main/java/com/boydti/fawe/example/CharFaweChunk.java @@ -315,6 +315,8 @@ public abstract class CharFaweChunk extends FaweChunk case 172: case 173: case 174: + case 188: + case 189: case 190: case 191: case 192: @@ -328,9 +330,6 @@ public abstract class CharFaweChunk extends FaweChunk case 10: case 54: case 146: - case 137: - case 188: - case 189: case 61: case 65: case 68: // removed diff --git a/core/src/main/java/com/boydti/fawe/object/FaweChunk.java b/core/src/main/java/com/boydti/fawe/object/FaweChunk.java index 4e122c53..2ea3ee0c 100644 --- a/core/src/main/java/com/boydti/fawe/object/FaweChunk.java +++ b/core/src/main/java/com/boydti/fawe/object/FaweChunk.java @@ -137,7 +137,9 @@ public abstract class FaweChunk implements Callable { * @param layer * @return char[] or null */ - public @Nullable char[] getIdArray(int layer) { + public + @Nullable + char[] getIdArray(int layer) { char[] ids = new char[4096]; int by = layer << 4; int index = 0; @@ -180,22 +182,22 @@ public abstract class FaweChunk implements Callable { char[][] ids = new char[HEIGHT >> 4][]; for (int y = 0; y < HEIGHT >> 4; y++) { int y4 = y >> 4; - short[][] i1 = FaweCache.CACHE_J[y]; - for (int z = 0; z < 16; z++) { - short[] i2 = i1[z]; - for (int x = 0; x < 16; x++) { - int combined = getBlockCombinedId(x, y, z); - if (combined == 0) { - continue; - } - char[] array = ids[y4]; - if (array == null) { - array = ids[y4] = new char[4096]; - } - int index = i2[x]; - array[index] = (char) combined; + short[][] i1 = FaweCache.CACHE_J[y]; + for (int z = 0; z < 16; z++) { + short[] i2 = i1[z]; + for (int x = 0; x < 16; x++) { + int combined = getBlockCombinedId(x, y, z); + if (combined == 0) { + continue; } + char[] array = ids[y4]; + if (array == null) { + array = ids[y4] = new char[4096]; + } + int index = i2[x]; + array[index] = (char) combined; } + } } return ids; } @@ -297,7 +299,8 @@ public abstract class FaweChunk implements Callable { * * @return * @see com.boydti.fawe.util.MathMan#unpair16x (get0) => x - * @see com.boydti.fawe.util.MathMan#unpair16y (get0) => z get1 => y + * @see com.boydti.fawe.util.MathMan#unpair16y (get0) => z + * get1 => y */ public abstract Map getTiles(); diff --git a/core/src/main/java/com/boydti/fawe/object/extent/FastWorldEditExtent.java b/core/src/main/java/com/boydti/fawe/object/extent/FastWorldEditExtent.java index d5eea6fe..1234af9e 100644 --- a/core/src/main/java/com/boydti/fawe/object/extent/FastWorldEditExtent.java +++ b/core/src/main/java/com/boydti/fawe/object/extent/FastWorldEditExtent.java @@ -1,8 +1,5 @@ package com.boydti.fawe.object.extent; -import java.util.List; -import java.util.Map; - import com.boydti.fawe.FaweCache; import com.boydti.fawe.object.FaweQueue; import com.boydti.fawe.object.HasFaweQueue; @@ -24,6 +21,8 @@ import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BaseBiome; +import java.util.List; +import java.util.Map; public class FastWorldEditExtent extends AbstractDelegateExtent implements HasFaweQueue { @@ -38,7 +37,6 @@ public class FastWorldEditExtent extends AbstractDelegateExtent implements HasFa this.maxY = world.getMaxY(); } - @Override public FaweQueue getQueue() { return queue; } @@ -156,284 +154,283 @@ public class FastWorldEditExtent extends AbstractDelegateExtent implements HasFa public boolean setBlock(int x, int y, int z, final BaseBlock block) throws WorldEditException { int id = block.getId(); switch (id) { - case 63: { - // Fix for signs - CompoundTag nbt = block.getNbtData(); - return queue.setBlock(x, y, z, id, block.getData(), nbt != null && !MainUtil.isValidSign(nbt) ? null : nbt); - } - case 65: // Fix rotation - case 68: - case 54: - case 146: - case 61: { - // Fix for default block rotation - byte data = (byte) block.getData(); - if (data == 0) { - data = 2; + case 63: { + // Fix for signs + CompoundTag nbt = block.getNbtData(); + return queue.setBlock(x, y, z, id, block.getData(), nbt != null && !MainUtil.isValidSign(nbt) ? null : nbt); } - return queue.setBlock(x, y, z, id, data, block.getNbtData()); - } - case 0: // No data - case 2: - case 4: - case 13: - case 14: - case 15: - case 20: - case 21: - case 22: - case 30: - case 32: - case 37: - case 39: - case 40: - case 41: - case 42: - case 45: - case 46: - case 47: - case 48: - case 49: - case 51: - case 56: - case 57: - case 58: - case 7: - case 73: - case 74: - case 79: - case 80: - case 81: - case 82: - case 83: - case 85: - case 87: - case 88: - case 101: - case 102: - case 103: - case 110: - case 112: - case 113: - case 121: - case 122: - case 129: - case 133: - case 165: - case 166: - case 169: - case 172: - case 173: - case 174: - case 190: - case 191: - case 192: - // No data - return queue.setBlock(x, y, z, id); - case 1: // No tiles - case 3: - case 5: - case 6: - case 8: - case 9: - case 10: - case 11: - case 12: - case 16: - case 17: - case 18: - case 19: - case 24: - case 31: - case 34: - case 35: - case 36: - case 38: - case 43: - case 44: - case 50: - case 53: - case 55: - case 59: - case 60: - case 64: - case 67: - case 69: - case 70: - case 71: - case 72: - case 75: - case 76: - case 77: - case 78: - case 89: - case 90: - case 91: - case 92: - case 93: - case 94: - case 95: - case 96: - case 97: - case 98: - case 99: - case 100: - case 104: - case 105: - case 106: - case 107: - case 108: - case 109: - case 111: - case 114: - case 115: - case 118: - case 120: - case 125: - case 126: - case 127: - case 128: - case 131: - case 132: - case 134: - case 135: - case 136: - case 139: - case 141: - case 143: - case 145: - case 147: - case 148: - case 152: - case 153: - case 155: - case 156: - case 159: - case 160: - case 161: - case 162: - case 163: - case 164: - case 167: - case 168: - case 170: - case 171: - case 175: - case 179: - case 180: - case 181: - case 182: - case 183: - case 184: - case 185: - case 186: - case 187: - case 193: - case 194: - case 195: - case 196: - case 197: - case 198: - case 199: - case 200: - case 201: - case 202: - case 203: - case 204: - case 205: - case 206: - case 207: - case 208: - case 212: - case 213: - case 214: - case 215: - case 216: - case 217: - case 235: - case 236: - case 237: - case 238: - case 239: - case 240: - case 241: - case 242: - case 243: - case 244: - case 245: - case 246: - case 247: - case 248: - case 249: - case 250: - case 251: - case 252: { - return queue.setBlock(x, y, z, id, block.getData()); - } - case 26: // Tiles - case 218: - case 130: - case 142: - case 27: - case 137: - case 188: - case 189: - case 52: - case 154: - case 84: - case 25: - case 144: - case 138: - case 176: - case 177: - case 119: - case 323: - case 117: - case 116: - case 28: - case 66: - case 157: - case 62: - case 140: - case 149: - case 150: - case 158: - case 23: - case 123: - case 124: - case 29: - case 33: - case 151: - case 178: - case 209: - case 210: - case 211: - case 255: - case 219: - case 220: - case 221: - case 222: - case 223: - case 224: - case 225: - case 226: - case 227: - case 228: - case 229: - case 230: - case 231: - case 232: - case 233: - case 234: - default: { - - CompoundTag nbt = block.getNbtData(); - if (nbt != null) { - return queue.setBlock(x, y, z, id, block.getData(), nbt); - } else { + case 65: // Fix rotation + case 68: + case 54: + case 146: + case 61: { + // Fix for default block rotation + byte data = (byte) block.getData(); + if (data == 0) { + data = 2; + } + return queue.setBlock(x, y, z, id, data, block.getNbtData()); + } + case 0: // No data + case 2: + case 4: + case 13: + case 14: + case 15: + case 20: + case 21: + case 22: + case 30: + case 32: + case 37: + case 39: + case 40: + case 41: + case 42: + case 45: + case 46: + case 47: + case 48: + case 49: + case 51: + case 56: + case 57: + case 58: + case 7: + case 73: + case 74: + case 79: + case 80: + case 81: + case 82: + case 83: + case 85: + case 87: + case 88: + case 101: + case 102: + case 103: + case 110: + case 112: + case 113: + case 121: + case 122: + case 129: + case 133: + case 165: + case 166: + case 169: + case 172: + case 173: + case 174: + case 188: + case 189: + case 190: + case 191: + case 192: + // No data + return queue.setBlock(x, y, z, id); + case 1: // No tiles + case 3: + case 5: + case 6: + case 8: + case 9: + case 10: + case 11: + case 12: + case 16: + case 17: + case 18: + case 19: + case 24: + case 31: + case 34: + case 35: + case 36: + case 38: + case 43: + case 44: + case 50: + case 53: + case 55: + case 59: + case 60: + case 64: + case 67: + case 69: + case 70: + case 71: + case 72: + case 75: + case 76: + case 77: + case 78: + case 89: + case 90: + case 91: + case 92: + case 93: + case 94: + case 95: + case 96: + case 97: + case 98: + case 99: + case 100: + case 104: + case 105: + case 106: + case 107: + case 108: + case 109: + case 111: + case 114: + case 115: + case 118: + case 120: + case 125: + case 126: + case 127: + case 128: + case 131: + case 132: + case 134: + case 135: + case 136: + case 139: + case 141: + case 143: + case 145: + case 147: + case 148: + case 152: + case 153: + case 155: + case 156: + case 159: + case 160: + case 161: + case 162: + case 163: + case 164: + case 167: + case 168: + case 170: + case 171: + case 175: + case 179: + case 180: + case 181: + case 182: + case 183: + case 184: + case 185: + case 186: + case 187: + case 193: + case 194: + case 195: + case 196: + case 197: + case 198: + case 199: + case 200: + case 201: + case 202: + case 203: + case 204: + case 205: + case 206: + case 207: + case 208: + case 212: + case 213: + case 214: + case 215: + case 216: + case 217: + case 235: + case 236: + case 237: + case 238: + case 239: + case 240: + case 241: + case 242: + case 243: + case 244: + case 245: + case 246: + case 247: + case 248: + case 249: + case 250: + case 251: + case 252: { return queue.setBlock(x, y, z, id, block.getData()); } - } + case 26: // Tiles + case 218: + case 130: + case 142: + case 27: + case 137: + case 52: + case 154: + case 84: + case 25: + case 144: + case 138: + case 176: + case 177: + case 119: + case 323: + case 117: + case 116: + case 28: + case 66: + case 157: + case 62: + case 140: + case 149: + case 150: + case 158: + case 23: + case 123: + case 124: + case 29: + case 33: + case 151: + case 178: + case 209: + case 210: + case 211: + case 255: + case 219: + case 220: + case 221: + case 222: + case 223: + case 224: + case 225: + case 226: + case 227: + case 228: + case 229: + case 230: + case 231: + case 232: + case 233: + case 234: + default: { + CompoundTag nbt = block.getNbtData(); + if (nbt != null) { + return queue.setBlock(x, y, z, id, block.getData(), nbt); + } else { + return queue.setBlock(x, y, z, id, block.getData()); + } + } } } } diff --git a/core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java b/core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java index 21e7acd5..8a04067f 100644 --- a/core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java +++ b/core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java @@ -214,8 +214,6 @@ public class CuboidClipboard { case 142: case 27: case 137: - case 188: - case 189: case 52: case 154: case 84: @@ -345,6 +343,8 @@ public class CuboidClipboard { case 172: case 173: case 174: + case 188: + case 189: case 190: case 191: case 192: { diff --git a/core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java b/core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java index a549176c..637dabad 100644 --- a/core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java +++ b/core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java @@ -98,13 +98,6 @@ public class BundledBlockData { List entries = gson.fromJson(data, new TypeToken>() { }.getType()); for (BlockEntry entry : entries) { - - if (entry.legacyId == 210){ - entry.legacyId = 188; - } else if (entry.legacyId == 211){ - entry.legacyId = 189; - } - System.out.println("BundledBlockData::Adding block entry: " + entry.id + " (" + entry.legacyId + ")"); add(entry, overwrite); } }