Skip to content

Commit

Permalink
Make sure turn is positive
Browse files Browse the repository at this point in the history
  • Loading branch information
gtosh4 committed Jul 27, 2023
1 parent 238a57e commit e3681f6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,11 @@ public BaseBlock transformBlock(BaseBlock block, Transform transform) {
} else {
int idx = rotationIndex(z_rotations, side);
side = z_rotations[(idx + 4 - ticks) % 4];
turn = (byte) ((turn - ticks) % 4);
turn = (byte) ((turn + 4 - ticks) % 4);
}
}
CompoundTagBuilder newNbt = nbt.createBuilder();
turn = (byte) ((turn + 4) % 4); // make sure turn is positive
newNbt.putByte("side", side);
newNbt.putByte("turn", turn);
return new BaseBlock(block.getId(), block.getData(), newNbt.build());
Expand Down

0 comments on commit e3681f6

Please sign in to comment.