From 34348a6d166c939d3fe6d488523e5d891c606af2 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Sat, 2 Jan 2021 13:07:26 -0600 Subject: [PATCH] Pad chunksnapshots with empty section (avoid y=256 exceptions) --- .../dynmap/bukkit/helper/v114_1/MapChunkCache114_1.java | 8 ++++---- .../org/dynmap/bukkit/helper/v115/MapChunkCache115.java | 8 ++++---- .../dynmap/bukkit/helper/v116_2/MapChunkCache116_2.java | 8 ++++---- .../dynmap/bukkit/helper/v116_3/MapChunkCache116_3.java | 8 ++++---- .../dynmap/bukkit/helper/v116_4/MapChunkCache116_4.java | 8 ++++---- .../org/dynmap/bukkit/helper/v116/MapChunkCache116.java | 8 ++++---- .../main/java/org/dynmap/fabric_1_15_2/ChunkSnapshot.java | 8 ++++---- .../main/java/org/dynmap/fabric_1_16_1/ChunkSnapshot.java | 8 ++++---- .../main/java/org/dynmap/fabric_1_16_2/ChunkSnapshot.java | 8 ++++---- .../main/java/org/dynmap/fabric_1_16_4/ChunkSnapshot.java | 8 ++++---- .../main/java/org/dynmap/forge_1_11_2/ChunkSnapshot.java | 8 ++++---- .../main/java/org/dynmap/forge_1_12_2/ChunkSnapshot.java | 8 ++++---- .../main/java/org/dynmap/forge_1_13_2/ChunkSnapshot.java | 8 ++++---- .../main/java/org/dynmap/forge_1_14_4/ChunkSnapshot.java | 8 ++++---- .../main/java/org/dynmap/forge_1_15_2/ChunkSnapshot.java | 8 ++++---- .../main/java/org/dynmap/forge_1_16_1/ChunkSnapshot.java | 8 ++++---- .../main/java/org/dynmap/forge_1_16_2/ChunkSnapshot.java | 8 ++++---- .../main/java/org/dynmap/forge_1_16_3/ChunkSnapshot.java | 8 ++++---- 18 files changed, 72 insertions(+), 72 deletions(-) diff --git a/bukkit-helper-114-1/src/main/java/org/dynmap/bukkit/helper/v114_1/MapChunkCache114_1.java b/bukkit-helper-114-1/src/main/java/org/dynmap/bukkit/helper/v114_1/MapChunkCache114_1.java index 54997319..eddd5761 100644 --- a/bukkit-helper-114-1/src/main/java/org/dynmap/bukkit/helper/v114_1/MapChunkCache114_1.java +++ b/bukkit-helper-114-1/src/main/java/org/dynmap/bukkit/helper/v114_1/MapChunkCache114_1.java @@ -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 */ diff --git a/bukkit-helper-115/src/main/java/org/dynmap/bukkit/helper/v115/MapChunkCache115.java b/bukkit-helper-115/src/main/java/org/dynmap/bukkit/helper/v115/MapChunkCache115.java index 326287ce..3b556470 100644 --- a/bukkit-helper-115/src/main/java/org/dynmap/bukkit/helper/v115/MapChunkCache115.java +++ b/bukkit-helper-115/src/main/java/org/dynmap/bukkit/helper/v115/MapChunkCache115.java @@ -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 */ diff --git a/bukkit-helper-116-2/src/main/java/org/dynmap/bukkit/helper/v116_2/MapChunkCache116_2.java b/bukkit-helper-116-2/src/main/java/org/dynmap/bukkit/helper/v116_2/MapChunkCache116_2.java index 29220373..1e7cbc36 100644 --- a/bukkit-helper-116-2/src/main/java/org/dynmap/bukkit/helper/v116_2/MapChunkCache116_2.java +++ b/bukkit-helper-116-2/src/main/java/org/dynmap/bukkit/helper/v116_2/MapChunkCache116_2.java @@ -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 */ diff --git a/bukkit-helper-116-3/src/main/java/org/dynmap/bukkit/helper/v116_3/MapChunkCache116_3.java b/bukkit-helper-116-3/src/main/java/org/dynmap/bukkit/helper/v116_3/MapChunkCache116_3.java index 42bdbc69..cc75b580 100644 --- a/bukkit-helper-116-3/src/main/java/org/dynmap/bukkit/helper/v116_3/MapChunkCache116_3.java +++ b/bukkit-helper-116-3/src/main/java/org/dynmap/bukkit/helper/v116_3/MapChunkCache116_3.java @@ -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 */ diff --git a/bukkit-helper-116-4/src/main/java/org/dynmap/bukkit/helper/v116_4/MapChunkCache116_4.java b/bukkit-helper-116-4/src/main/java/org/dynmap/bukkit/helper/v116_4/MapChunkCache116_4.java index 652a8bd7..06349890 100644 --- a/bukkit-helper-116-4/src/main/java/org/dynmap/bukkit/helper/v116_4/MapChunkCache116_4.java +++ b/bukkit-helper-116-4/src/main/java/org/dynmap/bukkit/helper/v116_4/MapChunkCache116_4.java @@ -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 */ diff --git a/bukkit-helper-116/src/main/java/org/dynmap/bukkit/helper/v116/MapChunkCache116.java b/bukkit-helper-116/src/main/java/org/dynmap/bukkit/helper/v116/MapChunkCache116.java index 2ab91d1d..72430d29 100644 --- a/bukkit-helper-116/src/main/java/org/dynmap/bukkit/helper/v116/MapChunkCache116.java +++ b/bukkit-helper-116/src/main/java/org/dynmap/bukkit/helper/v116/MapChunkCache116.java @@ -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 */ diff --git a/fabric-1.15.2/src/main/java/org/dynmap/fabric_1_15_2/ChunkSnapshot.java b/fabric-1.15.2/src/main/java/org/dynmap/fabric_1_15_2/ChunkSnapshot.java index 0f1ea96a..c02fc03e 100644 --- a/fabric-1.15.2/src/main/java/org/dynmap/fabric_1_15_2/ChunkSnapshot.java +++ b/fabric-1.15.2/src/main/java/org/dynmap/fabric_1_15_2/ChunkSnapshot.java @@ -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 */ diff --git a/fabric-1.16.1/src/main/java/org/dynmap/fabric_1_16_1/ChunkSnapshot.java b/fabric-1.16.1/src/main/java/org/dynmap/fabric_1_16_1/ChunkSnapshot.java index ebdd394b..a8e95490 100644 --- a/fabric-1.16.1/src/main/java/org/dynmap/fabric_1_16_1/ChunkSnapshot.java +++ b/fabric-1.16.1/src/main/java/org/dynmap/fabric_1_16_1/ChunkSnapshot.java @@ -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 */ diff --git a/fabric-1.16.2/src/main/java/org/dynmap/fabric_1_16_2/ChunkSnapshot.java b/fabric-1.16.2/src/main/java/org/dynmap/fabric_1_16_2/ChunkSnapshot.java index 89a436c3..a1daacc9 100644 --- a/fabric-1.16.2/src/main/java/org/dynmap/fabric_1_16_2/ChunkSnapshot.java +++ b/fabric-1.16.2/src/main/java/org/dynmap/fabric_1_16_2/ChunkSnapshot.java @@ -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 */ diff --git a/fabric-1.16.4/src/main/java/org/dynmap/fabric_1_16_4/ChunkSnapshot.java b/fabric-1.16.4/src/main/java/org/dynmap/fabric_1_16_4/ChunkSnapshot.java index 9f59e85e..3e2e688a 100644 --- a/fabric-1.16.4/src/main/java/org/dynmap/fabric_1_16_4/ChunkSnapshot.java +++ b/fabric-1.16.4/src/main/java/org/dynmap/fabric_1_16_4/ChunkSnapshot.java @@ -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 */ diff --git a/forge-1.11.2/src/main/java/org/dynmap/forge_1_11_2/ChunkSnapshot.java b/forge-1.11.2/src/main/java/org/dynmap/forge_1_11_2/ChunkSnapshot.java index e5e0a051..e463fd0e 100644 --- a/forge-1.11.2/src/main/java/org/dynmap/forge_1_11_2/ChunkSnapshot.java +++ b/forge-1.11.2/src/main/java/org/dynmap/forge_1_11_2/ChunkSnapshot.java @@ -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 */ diff --git a/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/ChunkSnapshot.java b/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/ChunkSnapshot.java index f55d7488..478c045b 100644 --- a/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/ChunkSnapshot.java +++ b/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/ChunkSnapshot.java @@ -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 */ diff --git a/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/ChunkSnapshot.java b/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/ChunkSnapshot.java index e85cc2b7..1078a3eb 100644 --- a/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/ChunkSnapshot.java +++ b/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/ChunkSnapshot.java @@ -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 */ diff --git a/forge-1.14.4/src/main/java/org/dynmap/forge_1_14_4/ChunkSnapshot.java b/forge-1.14.4/src/main/java/org/dynmap/forge_1_14_4/ChunkSnapshot.java index d07a7a7f..a8edc9af 100644 --- a/forge-1.14.4/src/main/java/org/dynmap/forge_1_14_4/ChunkSnapshot.java +++ b/forge-1.14.4/src/main/java/org/dynmap/forge_1_14_4/ChunkSnapshot.java @@ -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 */ diff --git a/forge-1.15.2/src/main/java/org/dynmap/forge_1_15_2/ChunkSnapshot.java b/forge-1.15.2/src/main/java/org/dynmap/forge_1_15_2/ChunkSnapshot.java index 4ff4e0c2..066dd1a5 100644 --- a/forge-1.15.2/src/main/java/org/dynmap/forge_1_15_2/ChunkSnapshot.java +++ b/forge-1.15.2/src/main/java/org/dynmap/forge_1_15_2/ChunkSnapshot.java @@ -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 */ diff --git a/forge-1.16.1/src/main/java/org/dynmap/forge_1_16_1/ChunkSnapshot.java b/forge-1.16.1/src/main/java/org/dynmap/forge_1_16_1/ChunkSnapshot.java index 0c95a65a..7a20b203 100644 --- a/forge-1.16.1/src/main/java/org/dynmap/forge_1_16_1/ChunkSnapshot.java +++ b/forge-1.16.1/src/main/java/org/dynmap/forge_1_16_1/ChunkSnapshot.java @@ -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 */ diff --git a/forge-1.16.2/src/main/java/org/dynmap/forge_1_16_2/ChunkSnapshot.java b/forge-1.16.2/src/main/java/org/dynmap/forge_1_16_2/ChunkSnapshot.java index 6b9ea4a4..e7202647 100644 --- a/forge-1.16.2/src/main/java/org/dynmap/forge_1_16_2/ChunkSnapshot.java +++ b/forge-1.16.2/src/main/java/org/dynmap/forge_1_16_2/ChunkSnapshot.java @@ -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 */ diff --git a/forge-1.16.3/src/main/java/org/dynmap/forge_1_16_3/ChunkSnapshot.java b/forge-1.16.3/src/main/java/org/dynmap/forge_1_16_3/ChunkSnapshot.java index ac26a615..3f4f36c4 100644 --- a/forge-1.16.3/src/main/java/org/dynmap/forge_1_16_3/ChunkSnapshot.java +++ b/forge-1.16.3/src/main/java/org/dynmap/forge_1_16_3/ChunkSnapshot.java @@ -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 */