Fix position shifting, fix two layers of item copy

This commit is contained in:
creeper123123321 2019-11-27 16:38:42 -03:00
parent de97b5b15f
commit 875d2392b5
3 changed files with 4 additions and 4 deletions

View File

@ -24,6 +24,6 @@ public class Position1_14Type extends Type<Position> {
public void write(ByteBuf buffer, Position object) {
buffer.writeLong((((long) object.getX() & 0x3ffffff) << 38)
| (object.getY() & 0xfff)
| ((object.getZ() & 0x3ffffff) << 12));
| ((((long) object.getZ()) & 0x3ffffff) << 12));
}
}

View File

@ -23,7 +23,7 @@ public class PositionType extends Type<Position> {
@Override
public void write(ByteBuf buffer, Position object) {
buffer.writeLong((((long) object.getX() & 0x3ffffff) << 38)
| ((object.getY() & 0xfff) << 26)
| ((((long) object.getY()) & 0xfff) << 26)
| (object.getZ() & 0x3ffffff));
}
}

View File

@ -515,7 +515,7 @@ public class Protocol1_13To1_12_2 extends Protocol {
Item[] clone = ingredient.clone(); // Clone because array and item is mutable
for (int i = 0; i < clone.length; i++) {
if (clone[i] == null) continue;
clone[i] = new Item(new Item(clone[i]));
clone[i] = new Item(clone[i]);
}
wrapper.write(Type.FLAT_ITEM_ARRAY_VAR_INT, clone);
}
@ -530,7 +530,7 @@ public class Protocol1_13To1_12_2 extends Protocol {
Item[] clone = ingredient.clone(); // Clone because array and item is mutable
for (int i = 0; i < clone.length; i++) {
if (clone[i] == null) continue;
clone[i] = new Item(new Item(clone[i]));
clone[i] = new Item(clone[i]);
}
wrapper.write(Type.FLAT_ITEM_ARRAY_VAR_INT, clone);
}