mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 18:15:39 +01:00
Fix position shifting, fix two layers of item copy
This commit is contained in:
parent
de97b5b15f
commit
875d2392b5
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user