diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/MetadataRewriter.java b/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/MetadataRewriter.java index 250435086..a397cdc3a 100644 --- a/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/MetadataRewriter.java +++ b/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/MetadataRewriter.java @@ -32,12 +32,40 @@ public class MetadataRewriter { if (currentType == 54) { // ZombieVillager - 27 // Husk - 23 + Optional options = getById(metadata, 13); + if (options.isPresent()) { + if (((int) options.get().getValue()) == 0) { + return currentType; + } + if (((int) options.get().getValue()) == 6) { + return 23; + } + int profession = ((int) options.get().getValue()) - 1; + } } if (currentType == 100) { // SkeletonHorse - 28 // ZombieHorse - 29 // Donkey - 31 // Mule - 32 + Optional options = getById(metadata, 14); + if (options.isPresent()) { + if (((int) options.get().getValue()) == 0) { + return currentType; + } + if (((int) options.get().getValue()) == 1) { + return 31; + } + if (((int) options.get().getValue()) == 2) { + return 32; + } + if (((int) options.get().getValue()) == 3) { + return 29; + } + if (((int) options.get().getValue()) == 4) { + return 28; + } + } } return currentType; } diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/ProtocolSnapshotTo1_10.java b/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/ProtocolSnapshotTo1_10.java index 3bea29d62..79a731568 100644 --- a/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/ProtocolSnapshotTo1_10.java +++ b/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/ProtocolSnapshotTo1_10.java @@ -38,8 +38,12 @@ public class ProtocolSnapshotTo1_10 extends Protocol { handler(new PacketHandler() { @Override public void handle(PacketWrapper wrapper) throws Exception { + // Change Type :) + int type = wrapper.get(Type.VAR_INT, 1); + type = MetadataRewriter.rewriteEntityType(type, wrapper.get(Types1_9.METADATA_LIST, 0)); + wrapper.set(Type.VAR_INT, 1, type); // Register Type ID - wrapper.user().get(EntityTracker.class).getClientEntityTypes().put(wrapper.get(Type.VAR_INT, 0), wrapper.get(Type.VAR_INT, 1)); + wrapper.user().get(EntityTracker.class).getClientEntityTypes().put(wrapper.get(Type.VAR_INT, 0), type); } }); }