From ab5eb2c7ef92d5ace385c583db21491a8dd2b26d Mon Sep 17 00:00:00 2001 From: Gerrygames Date: Wed, 20 Feb 2019 20:12:20 +0100 Subject: [PATCH] 19w08a metadata changes --- .../MetadataRewriter.java | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/MetadataRewriter.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/MetadataRewriter.java index 41b5b835e..b4eac577e 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/MetadataRewriter.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/MetadataRewriter.java @@ -32,20 +32,38 @@ public class MetadataRewriter { if (type == null) continue; - if (type.isOrHasParent(Entity1_14Types.EntityType.MINECART_ABSTRACT) && metadata.getId() == 9) { - // New block format - int data = (int) metadata.getValue(); - metadata.setValue(Protocol1_14To1_13_2.getNewBlockStateId(data)); + //Metadata 6 added to abstract_entity + if (metadata.getId() > 5) { + metadata.setId(metadata.getId() + 1); + } + + //Metadata 12 added to living_entity + if (metadata.getId() > 11 && type.isOrHasParent(Entity1_14Types.EntityType.LIVINGENTITY)) { + metadata.setId(metadata.getId() + 1); + } + + if (type.isOrHasParent(Entity1_14Types.EntityType.MINECART_ABSTRACT)) { + if (metadata.getId() == 10) { + // New block format + int data = (int) metadata.getValue(); + metadata.setValue(Protocol1_14To1_13_2.getNewBlockStateId(data)); + } + } + + if (type.is(Entity1_14Types.EntityType.HORSE)) { + if (metadata.getId() == 18) { + metadatas.remove(metadata); //TODO Probably sent as entity equipment now + } } if (type.is(Entity1_14Types.EntityType.VILLAGER)) { - if (metadata.getId() == 13) { + if (metadata.getId() == 15) { // plains metadata.setValue(new VillagerData(2, getNewProfessionId((int) metadata.getValue()), 0)); metadata.setMetaType(MetaType1_14.VillagerData); } } else if (type.is(Entity1_14Types.EntityType.ZOMBIE_VILLAGER)) { - if (metadata.getId() == 17) { + if (metadata.getId() == 19) { // plains metadata.setValue(new VillagerData(2, getNewProfessionId((int) metadata.getValue()), 0)); metadata.setMetaType(MetaType1_14.VillagerData); @@ -53,13 +71,13 @@ public class MetadataRewriter { } if (type.isOrHasParent(Entity1_14Types.EntityType.ARROW)) { - if (metadata.getId() >= 8) { + if (metadata.getId() >= 9) { metadata.setId(metadata.getId() + 1); } } if (type.is(Entity1_14Types.EntityType.FIREWORKS_ROCKET)) { - if (metadata.getId() == 7) { + if (metadata.getId() == 8) { if (metadata.getValue().equals(0)) metadata.setValue(null); // https://bugs.mojang.com/browse/MC-111480 metadata.setMetaType(MetaType1_14.OptVarInt); }