mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-12-24 01:17:40 +01:00
Transform FallingBlock to the new block format
This commit is contained in:
parent
acb960bfdf
commit
fbaaa78b81
@ -25,6 +25,12 @@ public class EntityPackets {
|
||||
map(Type.VAR_INT); // 0 - Entity id
|
||||
map(Type.UUID); // 1 - UUID
|
||||
map(Type.BYTE); // 2 - Type
|
||||
map(Type.DOUBLE); // 3 - X
|
||||
map(Type.DOUBLE); // 4 - Y
|
||||
map(Type.DOUBLE); // 5 - Z
|
||||
map(Type.BYTE); // 6 - Pitch
|
||||
map(Type.BYTE); // 7 - Yaw
|
||||
map(Type.INT); // 8 - Data
|
||||
|
||||
// Track Entity
|
||||
handler(new PacketHandler() {
|
||||
@ -34,7 +40,11 @@ public class EntityPackets {
|
||||
byte type = wrapper.get(Type.BYTE, 0);
|
||||
Entity1_13Types.EntityType entType = Entity1_13Types.getTypeFromId(type, true);
|
||||
|
||||
// TODO no object type changes so far
|
||||
if (entType != null && entType.is(Entity1_13Types.EntityType.FALLING_BLOCK)) {
|
||||
int oldId = wrapper.get(Type.INT, 0);
|
||||
int combined = (((oldId & 4095) << 4) | (oldId >> 12 & 15));
|
||||
wrapper.set(Type.INT, 0, WorldPackets.toNewId(combined));
|
||||
}
|
||||
|
||||
// Register Type ID
|
||||
wrapper.user().get(EntityTracker.class).addEntity(entityId, entType);
|
||||
|
Loading…
Reference in New Issue
Block a user