mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 02:35:49 +01:00
Clear out empty extended block ID array. Fixes BUKKIT-2923
If a chunk gets a block added to it that requires the extended block id nibble array (block id greater than 255) the array is created and saved with the chunk. When the blocks are verified to make sure they exist these entries are erased but the extended block id array is not. This causes the server and client to disagree about how much data a chunk has which makes the client crash while trying to load the chunk for rendering. To resolve these issues we now clear the extended block id array on chunk load if there is no valid data in it.
This commit is contained in:
parent
2b22ae2d45
commit
188a71ad5b
1 changed files with 14 additions and 0 deletions
|
@ -219,6 +219,20 @@ public class ChunkSection {
|
|||
}
|
||||
|
||||
public void a(NibbleArray nibblearray) {
|
||||
// CraftBukkit start - don't hang on to an empty nibble array
|
||||
boolean empty = true;
|
||||
for (int i = 0; i < nibblearray.a.length; i++) {
|
||||
if (nibblearray.a[i] != 0) {
|
||||
empty = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty) {
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
this.extBlockIds = nibblearray;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue