mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-13 11:18:23 +01:00
SPIGOT-6554: Worlds created with the bukkit ChunkGenerator cannot save
By: md_5 <git@md-5.net>
This commit is contained in:
parent
967b0303f3
commit
733b118606
1 changed files with 2 additions and 2 deletions
|
@ -30,7 +30,7 @@ public final class CraftChunkData implements ChunkGenerator.ChunkData {
|
|||
/* pp for tests */ CraftChunkData(int minHeight, int maxHeight) {
|
||||
this.minHeight = minHeight;
|
||||
this.maxHeight = maxHeight;
|
||||
sections = new ChunkSection[(maxHeight - minHeight) >> 4];
|
||||
sections = new ChunkSection[(((maxHeight - 1) >> 4) + 1) - (minHeight >> 4)];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -162,7 +162,7 @@ public final class CraftChunkData implements ChunkGenerator.ChunkData {
|
|||
int offset = (y - minHeight) >> 4;
|
||||
ChunkSection section = sections[offset];
|
||||
if (create && section == null) {
|
||||
sections[offset] = section = new ChunkSection(offset << 4);
|
||||
sections[offset] = section = new ChunkSection(offset + (minHeight >> 4));
|
||||
}
|
||||
return section;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue