Skip to content

Commit

Permalink
Handle bad heightmaps in 1.17->1.16.4 (#743)
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael authored May 9, 2024
1 parent 6292c5a commit 1a22b37
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ public void register() {

CompoundTag heightMaps = chunk.getHeightMap();
for (Tag heightMapTag : heightMaps.values()) {
if (!(heightMapTag instanceof LongArrayTag)) {
continue; // Client can handle bad data
}

LongArrayTag heightMap = (LongArrayTag) heightMapTag;
int[] heightMapData = new int[256];
int bitsPerEntry = MathUtil.ceilLog2((currentWorldSectionHeight << 4) + 1);
Expand Down

0 comments on commit 1a22b37

Please sign in to comment.