fix: do not cast block state to short (fixes #2543)

This commit is contained in:
mworzala 2025-01-01 08:51:08 -05:00
parent 5174263f83
commit d8c5831f4e
No known key found for this signature in database
GPG Key ID: B148F922E64797C7
2 changed files with 2 additions and 2 deletions

View File

@ -211,7 +211,7 @@ public class DynamicChunk extends Chunk {
final Section section = getSectionAt(y);
final int blockStateId = section.blockPalette()
.get(globalToSectionRelative(x), globalToSectionRelative(y), globalToSectionRelative(z));
return Objects.requireNonNullElse(Block.fromStateId((short) blockStateId), Block.AIR);
return Objects.requireNonNullElse(Block.fromStateId(blockStateId), Block.AIR);
}
@Override

View File

@ -97,7 +97,7 @@ public final class SnapshotImpl {
final Section section = sections[globalToChunk(y) - minSection];
final int blockStateId = section.blockPalette()
.get(globalToSectionRelative(x), globalToSectionRelative(y), globalToSectionRelative(z));
return Objects.requireNonNullElse(Block.fromStateId((short) blockStateId), Block.AIR);
return Objects.requireNonNullElse(Block.fromStateId(blockStateId), Block.AIR);
}
@Override