SPIGOT-6554: Worlds created with the bukkit ChunkGenerator cannot save
This commit is contained in:
parent
85b8c1fda6
commit
77058c79de
@ -30,7 +30,7 @@ public final class CraftChunkData implements ChunkGenerator.ChunkData {
|
|||||||
/* pp for tests */ CraftChunkData(int minHeight, int maxHeight) {
|
/* pp for tests */ CraftChunkData(int minHeight, int maxHeight) {
|
||||||
this.minHeight = minHeight;
|
this.minHeight = minHeight;
|
||||||
this.maxHeight = maxHeight;
|
this.maxHeight = maxHeight;
|
||||||
sections = new ChunkSection[(maxHeight - minHeight) >> 4];
|
sections = new ChunkSection[(((maxHeight - 1) >> 4) + 1) - (minHeight >> 4)];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -162,7 +162,7 @@ public final class CraftChunkData implements ChunkGenerator.ChunkData {
|
|||||||
int offset = (y - minHeight) >> 4;
|
int offset = (y - minHeight) >> 4;
|
||||||
ChunkSection section = sections[offset];
|
ChunkSection section = sections[offset];
|
||||||
if (create && section == null) {
|
if (create && section == null) {
|
||||||
sections[offset] = section = new ChunkSection(offset << 4);
|
sections[offset] = section = new ChunkSection(offset + (minHeight >> 4));
|
||||||
}
|
}
|
||||||
return section;
|
return section;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user