diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/MetadataRewriter.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/MetadataRewriter.java index 8f4c44240..053ee55d8 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/MetadataRewriter.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/MetadataRewriter.java @@ -20,10 +20,14 @@ public class MetadataRewriter { if (metadata.getMetaType().getTypeID() > 4) metadata.setMetaType(MetaType1_13.byId(metadata.getMetaType().getTypeID() + 1)); - // TODO Fix displayname + // Handle String -> Chat DisplayName if (metadata.getId() == 2) { metadata.setMetaType(MetaType1_13.OptChat); - metadata.setValue(metadata.getValue() != null ? Protocol1_9TO1_8.fixJson((String) metadata.getValue()) : null); + if (metadata.getValue() != null && !((String) metadata.getValue()).isEmpty()) { + metadata.setValue(Protocol1_9TO1_8.fixJson((String) metadata.getValue())); + } else { + metadata.setValue(null); + } } // 1.13 changed item to flat item (no data) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/ProtocolSnapshotTo1_12_2.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/ProtocolSnapshotTo1_12_2.java index ec8a72d4f..dec8c1d2c 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/ProtocolSnapshotTo1_12_2.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/ProtocolSnapshotTo1_12_2.java @@ -33,7 +33,7 @@ public class ProtocolSnapshotTo1_12_2 extends Protocol { // Outgoing packets // Statistics - registerOutgoing(State.PLAY, 0x7, 0x7, new PacketRemapper() { + registerOutgoing(State.PLAY, 0x07, 0x07, new PacketRemapper() { @Override public void registerMap() { // TODO: This packet has changed @@ -253,7 +253,19 @@ public class ProtocolSnapshotTo1_12_2 extends Protocol { registerOutgoing(State.PLAY, 0x4A, 0x4D); registerOutgoing(State.PLAY, 0x4B, 0x4E); registerOutgoing(State.PLAY, 0x4C, 0x4F); - registerOutgoing(State.PLAY, 0x4D, 0x50); + // Advancements + registerOutgoing(State.PLAY, 0x4D, 0x50, new PacketRemapper() { + @Override + public void registerMap() { + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + // TODO Temporary cancel advancements because of 'Non [a-z0-9/._-] character in path of location: minecraft:? https://fs.matsv.nl/media?id=auwje4z4lxw.png + wrapper.cancel(); + } + }); + } + }); registerOutgoing(State.PLAY, 0x4E, 0x51); registerOutgoing(State.PLAY, 0x4F, 0x52); // New packet 0x52 - Declare Recipes