Skip to content

Commit

Permalink
Unsigned cast to int to prevent negatives
Browse files Browse the repository at this point in the history
Replace calls to toUnsignedInt with bitwise equivalent for consistency with rest of code.
  • Loading branch information
spacebuilder2020 committed Feb 19, 2025
1 parent 932db3d commit 0da1b29
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ public Clipboard read(WorldData data) throws IOException {
}

BaseBlock block = new BaseBlock(
Short.toUnsignedInt(blocks[index]),
Byte.toUnsignedInt(blockData[index]) + (extraData != null ? (extraData[index] << 8) : 0));
blocks[index] & 0xFFFF,
(blockData[index] & 0xFF) + (extraData != null ? (extraData[index] & 0xFF << 8) : 0));

if (tileEntitiesMap.containsKey(pt)) {
BiPredicate<CompoundTag, String[]> isItem = (itemTag, idPtr) -> {
Expand Down

0 comments on commit 0da1b29

Please sign in to comment.