This commit is contained in:
Jesse Boyd 2017-08-18 15:05:38 +10:00
parent 2f344e29ce
commit 81ffd52e9f
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -306,13 +306,11 @@ public class BukkitChunk_1_7 extends CharFaweChunk<Chunk, BukkitQueue17> {
continue; continue;
} }
sections[j] = section = new ChunkSection(j << 4, flag); sections[j] = section = new ChunkSection(j << 4, flag);
section.setIdArray(null); BukkitQueue17.fieldCompactId.set(section, 0);
section.setIdArray(newIdArray); BukkitQueue17.fieldIds.set(section, newIdArray);
getParent().setCount(0, count - this.getAir(j), section); getParent().setCount(0, count - this.getAir(j), section);
section.setDataArray(null); BukkitQueue17.fieldCompactData.set(section, (byte) 0);
if (newDataArray != null) { BukkitQueue17.fieldData.set(section, newDataArray);
section.setDataArray(newDataArray);
}
continue; continue;
} }
if (count >= 4096) { if (count >= 4096) {
@ -320,13 +318,11 @@ public class BukkitChunk_1_7 extends CharFaweChunk<Chunk, BukkitQueue17> {
sections[j] = null; sections[j] = null;
continue; continue;
} }
section.setIdArray(null); BukkitQueue17.fieldCompactId.set(section, 0);
section.setIdArray(newIdArray); BukkitQueue17.fieldIds.set(section, newIdArray);
getParent().setCount(0, count - this.getAir(j), section); getParent().setCount(0, count - this.getAir(j), section);
section.setDataArray(null); BukkitQueue17.fieldCompactData.set(section, (byte) 0);
if (newDataArray != null) { BukkitQueue17.fieldData.set(section, newDataArray);
section.setDataArray(newDataArray);
}
continue; continue;
} }
char[] charArray = this.getIdArray(j); char[] charArray = this.getIdArray(j);
@ -358,21 +354,21 @@ public class BukkitChunk_1_7 extends CharFaweChunk<Chunk, BukkitQueue17> {
int i2 = i << 1; int i2 = i << 1;
int i3 = i2 + 1; int i3 = i2 + 1;
byte val = newDataArray.a[i]; byte val = newDataArray.a[i];
if (newIdArray[i3] != 0) { if (charArray[i3] != 0) {
if (newIdArray[i2] != 0) continue; if (charArray[i2] != 0) continue;
newDataArray.a[i] = (byte) (val & 240 | compactData); newDataArray.a[i] = (byte) (val & 240 | compactData);
continue; continue;
} }
if (newIdArray[i2] != 0) { if (charArray[i2] != 0) {
if (newIdArray[i3] != 0) continue; if (charArray[i3] != 0) continue;
newDataArray.a[i] = (byte) (val & 15 | (compactData) << 4); newDataArray.a[i] = (byte) (val & 15 | (compactData) << 4);
continue; continue;
} }
newDataArray.a[i] = full; newDataArray.a[i] = full;
} }
} }
section.setDataArray(null); BukkitQueue17.fieldCompactData.set(section, (byte) 0);
section.setDataArray(newDataArray); BukkitQueue17.fieldData.set(section, newDataArray);
} }
} else if (newDataArray == null) { } else if (newDataArray == null) {
for (int i = 0; i < currentDataArray.a.length; i++) { for (int i = 0; i < currentDataArray.a.length; i++) {
@ -402,8 +398,8 @@ public class BukkitChunk_1_7 extends CharFaweChunk<Chunk, BukkitQueue17> {
} else { } else {
for (int i = 0; i < 4096; i++) if (newIdArray[i] != 0) solid++; for (int i = 0; i < 4096; i++) if (newIdArray[i] != 0) solid++;
} }
section.setIdArray(null); BukkitQueue17.fieldCompactId.set(section, 0);
section.setIdArray(newIdArray); BukkitQueue17.fieldIds.set(section, newIdArray);
} else { } else {
for (int i = 0; i < 4096; i++) { for (int i = 0; i < 4096; i++) {
if (charArray[i] != 0) currentIdArray[i] = newIdArray[i]; if (charArray[i] != 0) currentIdArray[i] = newIdArray[i];
@ -412,12 +408,15 @@ public class BukkitChunk_1_7 extends CharFaweChunk<Chunk, BukkitQueue17> {
} }
if (data) { if (data) {
for (int k = 0; k < 4096; k++) { for (int k = 0; k < 4096; k++) {
int dataByte = FaweCache.getData(charArray[k]); int value = charArray[k];
int kShift = k >> 1; if (value != 0) {
if ((k & 1) == 0) { int dataByte = FaweCache.getData(value);
currentDataArray.a[kShift] = (byte) (currentDataArray.a[kShift] & 240 | dataByte); int kShift = k >> 1;
} else { if ((k & 1) == 0) {
currentDataArray.a[kShift] = (byte) (currentDataArray.a[kShift] & 15 | (dataByte) << 4); currentDataArray.a[kShift] = (byte) (currentDataArray.a[kShift] & 240 | dataByte);
} else {
currentDataArray.a[kShift] = (byte) (currentDataArray.a[kShift] & 15 | (dataByte) << 4);
}
} }
} }
} }