Revert "Added support for command blocks in Nukkit."

This reverts commit ba9aff2a8a.
This commit is contained in:
Dominik Renzel 2019-09-22 23:19:42 +02:00
parent d3cc84c026
commit a3cb8af95d
6 changed files with 893 additions and 902 deletions

File diff suppressed because it is too large Load Diff

View File

@ -315,6 +315,8 @@ public abstract class CharFaweChunk<T, V extends FaweQueue> extends FaweChunk<T>
case 172: case 172:
case 173: case 173:
case 174: case 174:
case 188:
case 189:
case 190: case 190:
case 191: case 191:
case 192: case 192:
@ -328,9 +330,6 @@ public abstract class CharFaweChunk<T, V extends FaweQueue> extends FaweChunk<T>
case 10: case 10:
case 54: case 54:
case 146: case 146:
case 137:
case 188:
case 189:
case 61: case 61:
case 65: case 65:
case 68: // removed case 68: // removed

View File

@ -137,7 +137,9 @@ public abstract class FaweChunk<T> implements Callable<FaweChunk> {
* @param layer * @param layer
* @return char[] or null * @return char[] or null
*/ */
public @Nullable char[] getIdArray(int layer) { public
@Nullable
char[] getIdArray(int layer) {
char[] ids = new char[4096]; char[] ids = new char[4096];
int by = layer << 4; int by = layer << 4;
int index = 0; int index = 0;
@ -180,22 +182,22 @@ public abstract class FaweChunk<T> implements Callable<FaweChunk> {
char[][] ids = new char[HEIGHT >> 4][]; char[][] ids = new char[HEIGHT >> 4][];
for (int y = 0; y < HEIGHT >> 4; y++) { for (int y = 0; y < HEIGHT >> 4; y++) {
int y4 = y >> 4; int y4 = y >> 4;
short[][] i1 = FaweCache.CACHE_J[y]; short[][] i1 = FaweCache.CACHE_J[y];
for (int z = 0; z < 16; z++) { for (int z = 0; z < 16; z++) {
short[] i2 = i1[z]; short[] i2 = i1[z];
for (int x = 0; x < 16; x++) { for (int x = 0; x < 16; x++) {
int combined = getBlockCombinedId(x, y, z); int combined = getBlockCombinedId(x, y, z);
if (combined == 0) { if (combined == 0) {
continue; continue;
}
char[] array = ids[y4];
if (array == null) {
array = ids[y4] = new char[4096];
}
int index = i2[x];
array[index] = (char) combined;
} }
char[] array = ids[y4];
if (array == null) {
array = ids[y4] = new char[4096];
}
int index = i2[x];
array[index] = (char) combined;
} }
}
} }
return ids; return ids;
} }
@ -297,7 +299,8 @@ public abstract class FaweChunk<T> implements Callable<FaweChunk> {
* *
* @return * @return
* @see com.boydti.fawe.util.MathMan#unpair16x (get0) => x * @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<Short, CompoundTag> getTiles(); public abstract Map<Short, CompoundTag> getTiles();

View File

@ -1,8 +1,5 @@
package com.boydti.fawe.object.extent; package com.boydti.fawe.object.extent;
import java.util.List;
import java.util.Map;
import com.boydti.fawe.FaweCache; import com.boydti.fawe.FaweCache;
import com.boydti.fawe.object.FaweQueue; import com.boydti.fawe.object.FaweQueue;
import com.boydti.fawe.object.HasFaweQueue; 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.util.Location;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.biome.BaseBiome;
import java.util.List;
import java.util.Map;
public class FastWorldEditExtent extends AbstractDelegateExtent implements HasFaweQueue { public class FastWorldEditExtent extends AbstractDelegateExtent implements HasFaweQueue {
@ -38,7 +37,6 @@ public class FastWorldEditExtent extends AbstractDelegateExtent implements HasFa
this.maxY = world.getMaxY(); this.maxY = world.getMaxY();
} }
@Override
public FaweQueue getQueue() { public FaweQueue getQueue() {
return queue; 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 { public boolean setBlock(int x, int y, int z, final BaseBlock block) throws WorldEditException {
int id = block.getId(); int id = block.getId();
switch (id) { switch (id) {
case 63: { case 63: {
// Fix for signs // Fix for signs
CompoundTag nbt = block.getNbtData(); 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, 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;
} }
return queue.setBlock(x, y, z, id, data, block.getNbtData()); case 65: // Fix rotation
} case 68:
case 0: // No data case 54:
case 2: case 146:
case 4: case 61: {
case 13: // Fix for default block rotation
case 14: byte data = (byte) block.getData();
case 15: if (data == 0) {
case 20: data = 2;
case 21: }
case 22: return queue.setBlock(x, y, z, id, data, block.getNbtData());
case 30: }
case 32: case 0: // No data
case 37: case 2:
case 39: case 4:
case 40: case 13:
case 41: case 14:
case 42: case 15:
case 45: case 20:
case 46: case 21:
case 47: case 22:
case 48: case 30:
case 49: case 32:
case 51: case 37:
case 56: case 39:
case 57: case 40:
case 58: case 41:
case 7: case 42:
case 73: case 45:
case 74: case 46:
case 79: case 47:
case 80: case 48:
case 81: case 49:
case 82: case 51:
case 83: case 56:
case 85: case 57:
case 87: case 58:
case 88: case 7:
case 101: case 73:
case 102: case 74:
case 103: case 79:
case 110: case 80:
case 112: case 81:
case 113: case 82:
case 121: case 83:
case 122: case 85:
case 129: case 87:
case 133: case 88:
case 165: case 101:
case 166: case 102:
case 169: case 103:
case 172: case 110:
case 173: case 112:
case 174: case 113:
case 190: case 121:
case 191: case 122:
case 192: case 129:
// No data case 133:
return queue.setBlock(x, y, z, id); case 165:
case 1: // No tiles case 166:
case 3: case 169:
case 5: case 172:
case 6: case 173:
case 8: case 174:
case 9: case 188:
case 10: case 189:
case 11: case 190:
case 12: case 191:
case 16: case 192:
case 17: // No data
case 18: return queue.setBlock(x, y, z, id);
case 19: case 1: // No tiles
case 24: case 3:
case 31: case 5:
case 34: case 6:
case 35: case 8:
case 36: case 9:
case 38: case 10:
case 43: case 11:
case 44: case 12:
case 50: case 16:
case 53: case 17:
case 55: case 18:
case 59: case 19:
case 60: case 24:
case 64: case 31:
case 67: case 34:
case 69: case 35:
case 70: case 36:
case 71: case 38:
case 72: case 43:
case 75: case 44:
case 76: case 50:
case 77: case 53:
case 78: case 55:
case 89: case 59:
case 90: case 60:
case 91: case 64:
case 92: case 67:
case 93: case 69:
case 94: case 70:
case 95: case 71:
case 96: case 72:
case 97: case 75:
case 98: case 76:
case 99: case 77:
case 100: case 78:
case 104: case 89:
case 105: case 90:
case 106: case 91:
case 107: case 92:
case 108: case 93:
case 109: case 94:
case 111: case 95:
case 114: case 96:
case 115: case 97:
case 118: case 98:
case 120: case 99:
case 125: case 100:
case 126: case 104:
case 127: case 105:
case 128: case 106:
case 131: case 107:
case 132: case 108:
case 134: case 109:
case 135: case 111:
case 136: case 114:
case 139: case 115:
case 141: case 118:
case 143: case 120:
case 145: case 125:
case 147: case 126:
case 148: case 127:
case 152: case 128:
case 153: case 131:
case 155: case 132:
case 156: case 134:
case 159: case 135:
case 160: case 136:
case 161: case 139:
case 162: case 141:
case 163: case 143:
case 164: case 145:
case 167: case 147:
case 168: case 148:
case 170: case 152:
case 171: case 153:
case 175: case 155:
case 179: case 156:
case 180: case 159:
case 181: case 160:
case 182: case 161:
case 183: case 162:
case 184: case 163:
case 185: case 164:
case 186: case 167:
case 187: case 168:
case 193: case 170:
case 194: case 171:
case 195: case 175:
case 196: case 179:
case 197: case 180:
case 198: case 181:
case 199: case 182:
case 200: case 183:
case 201: case 184:
case 202: case 185:
case 203: case 186:
case 204: case 187:
case 205: case 193:
case 206: case 194:
case 207: case 195:
case 208: case 196:
case 212: case 197:
case 213: case 198:
case 214: case 199:
case 215: case 200:
case 216: case 201:
case 217: case 202:
case 235: case 203:
case 236: case 204:
case 237: case 205:
case 238: case 206:
case 239: case 207:
case 240: case 208:
case 241: case 212:
case 242: case 213:
case 243: case 214:
case 244: case 215:
case 245: case 216:
case 246: case 217:
case 247: case 235:
case 248: case 236:
case 249: case 237:
case 250: case 238:
case 251: case 239:
case 252: { case 240:
return queue.setBlock(x, y, z, id, block.getData()); case 241:
} case 242:
case 26: // Tiles case 243:
case 218: case 244:
case 130: case 245:
case 142: case 246:
case 27: case 247:
case 137: case 248:
case 188: case 249:
case 189: case 250:
case 52: case 251:
case 154: case 252: {
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()); 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());
}
}
} }
} }
} }

View File

@ -214,8 +214,6 @@ public class CuboidClipboard {
case 142: case 142:
case 27: case 27:
case 137: case 137:
case 188:
case 189:
case 52: case 52:
case 154: case 154:
case 84: case 84:
@ -345,6 +343,8 @@ public class CuboidClipboard {
case 172: case 172:
case 173: case 173:
case 174: case 174:
case 188:
case 189:
case 190: case 190:
case 191: case 191:
case 192: { case 192: {

View File

@ -98,13 +98,6 @@ public class BundledBlockData {
List<BlockEntry> entries = gson.fromJson(data, new TypeToken<List<BlockEntry>>() { List<BlockEntry> entries = gson.fromJson(data, new TypeToken<List<BlockEntry>>() {
}.getType()); }.getType());
for (BlockEntry entry : entries) { 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); add(entry, overwrite);
} }
} }