Merge pull request #377 from MrGazdag/patch-5

Fix incorrect coordinate encoding in RelativeBlockBatch
This commit is contained in:
TheMode 2021-07-23 23:43:02 +02:00 committed by GitHub
commit 3628097438
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,9 +69,9 @@ public class RelativeBlockBatch implements Batch<Runnable> {
Check.argCondition(Math.abs(y) > Short.MAX_VALUE, "Relative y position may not be more than 16 bits long.");
Check.argCondition(Math.abs(z) > Short.MAX_VALUE, "Relative z position may not be more than 16 bits long.");
long pos = x;
pos = (pos << 16) | (short) y;
pos = (pos << 16) | (short) z;
long pos = Short.toUnsignedLong((short)x);
pos = (pos << 16) | Short.toUnsignedLong((short)y);
pos = (pos << 16) | Short.toUnsignedLong((short)z);
//final int block = (blockStateId << 16) | customBlockId;
synchronized (blockIdMap) {