From 15fec93bf1185ef40225b4b7b1ffba37a1c80437 Mon Sep 17 00:00:00 2001 From: KennyTV <28825609+KennyTV@users.noreply.github.com> Date: Mon, 4 Mar 2019 16:42:22 +0100 Subject: [PATCH] Fix minecart data --- .../packets/EntityPackets.java | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/packets/EntityPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/packets/EntityPackets.java index 5aa733d76..843f5da6e 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/packets/EntityPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/packets/EntityPackets.java @@ -57,6 +57,29 @@ public class EntityPackets { if (type1_14.is(Entity1_14Types.EntityType.FALLING_BLOCK)) { int data = wrapper.get(Type.INT, 0); wrapper.set(Type.INT, 0, Protocol1_14To1_13_2.getNewBlockStateId(data)); + } else if (type1_14.is(Entity1_14Types.EntityType.MINECART)) { + int data = wrapper.get(Type.INT, 0); + // default is 0 = rideable minecart + switch (data) { + case 1: + typeId = Entity1_14Types.EntityType.CHEST_MINECART.getId(); + break; + case 2: + typeId = Entity1_14Types.EntityType.FURNACE_MINECART.getId(); + break; + case 3: + typeId = Entity1_14Types.EntityType.TNT_MINECART.getId(); + break; + case 4: + typeId = Entity1_14Types.EntityType.SPAWNER_MINECART.getId(); + break; + case 5: + typeId = Entity1_14Types.EntityType.HOPPER_MINECART.getId(); + break; + case 6: + typeId = Entity1_14Types.EntityType.COMMANDBLOCK_MINECART.getId(); + break; + } } } @@ -162,8 +185,8 @@ public class EntityPackets { metadataPacket.write(Type.VAR_INT, wrapper.get(Type.VAR_INT, 0)); List metadataList = new LinkedList<>(); metadataList.add(new Metadata(12, MetaType1_14.OptPosition, null)); - metadataPacket.write(Types1_14.METADATA_LIST, metadataList); - metadataPacket.send(Protocol1_14To1_13_2.class); + metadataPacket.write(Types1_14.METADATA_LIST, metadataList); + metadataPacket.send(Protocol1_14To1_13_2.class); } } });