Pad chunksnapshots with empty section (avoid y=256 exceptions)

This commit is contained in:
Mike Primm 2021-01-02 13:07:26 -06:00
parent ed229cee93
commit 34348a6d16
18 changed files with 72 additions and 72 deletions

View File

@ -124,10 +124,10 @@ public class MapChunkCache114_1 extends AbstractMapChunkCache {
this.biomebase = new Object[COLUMNS_PER_CHUNK];
this.sectionCnt = worldheight / 16;
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
@ -150,9 +150,9 @@ public class MapChunkCache114_1 extends AbstractMapChunkCache {
this.inhabitedTicks = 0;
}
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
/* Get sections */

View File

@ -136,10 +136,10 @@ public class MapChunkCache115 extends AbstractMapChunkCache {
this.biomebase = new Object[COLUMNS_PER_CHUNK];
this.sectionCnt = worldheight / 16;
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
@ -162,9 +162,9 @@ public class MapChunkCache115 extends AbstractMapChunkCache {
this.inhabitedTicks = 0;
}
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
/* Get sections */

View File

@ -135,10 +135,10 @@ public class MapChunkCache116_2 extends AbstractMapChunkCache {
this.biomebase = new Object[COLUMNS_PER_CHUNK];
this.sectionCnt = worldheight / 16;
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
@ -161,9 +161,9 @@ public class MapChunkCache116_2 extends AbstractMapChunkCache {
this.inhabitedTicks = 0;
}
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
/* Get sections */

View File

@ -135,10 +135,10 @@ public class MapChunkCache116_3 extends AbstractMapChunkCache {
this.biomebase = new Object[COLUMNS_PER_CHUNK];
this.sectionCnt = worldheight / 16;
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
@ -161,9 +161,9 @@ public class MapChunkCache116_3 extends AbstractMapChunkCache {
this.inhabitedTicks = 0;
}
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
/* Get sections */

View File

@ -126,10 +126,10 @@ public class MapChunkCache116_4 extends AbstractMapChunkCache {
this.biomebase = new Object[COLUMNS_PER_CHUNK];
this.sectionCnt = worldheight / 16;
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
@ -152,9 +152,9 @@ public class MapChunkCache116_4 extends AbstractMapChunkCache {
this.inhabitedTicks = 0;
}
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
/* Get sections */

View File

@ -137,10 +137,10 @@ public class MapChunkCache116 extends AbstractMapChunkCache {
this.biomebase = new Object[COLUMNS_PER_CHUNK];
this.sectionCnt = worldheight / 16;
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
@ -163,9 +163,9 @@ public class MapChunkCache116 extends AbstractMapChunkCache {
this.inhabitedTicks = 0;
}
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
/* Get sections */

View File

@ -115,10 +115,10 @@ public class ChunkSnapshot {
this.biome = new int[COLUMNS_PER_CHUNK];
this.sectionCnt = worldheight / 16;
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
@ -154,9 +154,9 @@ public class ChunkSnapshot {
this.inhabitedTicks = 0;
}
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
/* Get sections */

View File

@ -114,10 +114,10 @@ public class ChunkSnapshot {
this.biome = new int[COLUMNS_PER_CHUNK];
this.sectionCnt = worldheight / 16;
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
@ -153,9 +153,9 @@ public class ChunkSnapshot {
this.inhabitedTicks = 0;
}
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
/* Get sections */

View File

@ -114,10 +114,10 @@ public class ChunkSnapshot {
this.biome = new int[COLUMNS_PER_CHUNK];
this.sectionCnt = worldheight / 16;
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
@ -153,9 +153,9 @@ public class ChunkSnapshot {
this.inhabitedTicks = 0;
}
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
/* Get sections */

View File

@ -114,10 +114,10 @@ public class ChunkSnapshot {
this.biome = new int[COLUMNS_PER_CHUNK];
this.sectionCnt = worldheight / 16;
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
@ -153,9 +153,9 @@ public class ChunkSnapshot {
this.inhabitedTicks = 0;
}
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
/* Get sections */

View File

@ -105,10 +105,10 @@ public class ChunkSnapshot
this.biome = new int[COLUMNS_PER_CHUNK];
this.sectionCnt = worldheight / 16;
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
@ -131,9 +131,9 @@ public class ChunkSnapshot
this.inhabitedTicks = 0;
}
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
/* Get sections */

View File

@ -105,10 +105,10 @@ public class ChunkSnapshot
this.biome = new int[COLUMNS_PER_CHUNK];
this.sectionCnt = worldheight / 16;
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
@ -131,9 +131,9 @@ public class ChunkSnapshot
this.inhabitedTicks = 0;
}
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
/* Get sections */

View File

@ -106,10 +106,10 @@ public class ChunkSnapshot
this.biome = new int[COLUMNS_PER_CHUNK];
this.sectionCnt = worldheight / 16;
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
@ -132,9 +132,9 @@ public class ChunkSnapshot
this.inhabitedTicks = 0;
}
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
/* Get sections */

View File

@ -106,10 +106,10 @@ public class ChunkSnapshot
this.biome = new int[COLUMNS_PER_CHUNK];
this.sectionCnt = worldheight / 16;
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
@ -132,9 +132,9 @@ public class ChunkSnapshot
this.inhabitedTicks = 0;
}
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
/* Get sections */

View File

@ -106,10 +106,10 @@ public class ChunkSnapshot
this.biome = new int[COLUMNS_PER_CHUNK];
this.sectionCnt = worldheight / 16;
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
@ -132,9 +132,9 @@ public class ChunkSnapshot
this.inhabitedTicks = 0;
}
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
/* Get sections */

View File

@ -107,10 +107,10 @@ public class ChunkSnapshot
this.biome = new int[COLUMNS_PER_CHUNK];
this.sectionCnt = worldheight / 16;
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
@ -133,9 +133,9 @@ public class ChunkSnapshot
this.inhabitedTicks = 0;
}
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
/* Get sections */

View File

@ -107,10 +107,10 @@ public class ChunkSnapshot
this.biome = new int[COLUMNS_PER_CHUNK];
this.sectionCnt = worldheight / 16;
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
@ -133,9 +133,9 @@ public class ChunkSnapshot
this.inhabitedTicks = 0;
}
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
/* Get sections */

View File

@ -107,10 +107,10 @@ public class ChunkSnapshot
this.biome = new int[COLUMNS_PER_CHUNK];
this.sectionCnt = worldheight / 16;
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
@ -133,9 +133,9 @@ public class ChunkSnapshot
this.inhabitedTicks = 0;
}
/* Allocate arrays indexed by section */
this.section = new Section[this.sectionCnt];
this.section = new Section[this.sectionCnt+1];
/* Fill with empty data */
for (int i = 0; i < this.sectionCnt; i++) {
for (int i = 0; i <= this.sectionCnt; i++) {
this.section[i] = empty_section;
}
/* Get sections */