From 1dc4a771a393c26868bb9b8a80b79a3e15e926f1 Mon Sep 17 00:00:00 2001 From: Marco Date: Wed, 22 May 2019 11:27:27 +0200 Subject: [PATCH] fix wandering traders + trades --- .../protocol1_13_2to1_14/Protocol1_13_2To1_14.java | 2 +- .../protocol1_13_2to1_14/packets/BlockItemPackets1_14.java | 6 +++--- .../protocol1_13_2to1_14/packets/EntityPackets1_14.java | 7 ++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/Protocol1_13_2To1_14.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/Protocol1_13_2To1_14.java index 9afa969a..9ce4f822 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/Protocol1_13_2To1_14.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/Protocol1_13_2To1_14.java @@ -253,7 +253,7 @@ public class Protocol1_13_2To1_14 extends BackwardsProtocol { registerIncoming(State.PLAY, 0x1E, 0x1C); // r registerIncoming(State.PLAY, 0x1F, 0x1D); // r registerIncoming(State.PLAY, 0x20, 0x1E); // r -// registerIncoming(State.PLAY, 0x21, 0x1F); // r TDO fix + registerIncoming(State.PLAY, 0x21, 0x1F); // r registerIncoming(State.PLAY, 0x22, 0x20); // r registerIncoming(State.PLAY, 0x23, 0x21); // r diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/packets/BlockItemPackets1_14.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/packets/BlockItemPackets1_14.java index 77182b1a..5a89863e 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/packets/BlockItemPackets1_14.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/packets/BlockItemPackets1_14.java @@ -170,10 +170,10 @@ public class BlockItemPackets1_14 extends BlockItemRewriter { ); Optional oldId = EntityTypeMapping.getOldId(type); if (!oldId.isPresent()) { - if (!hasData(entityType)) + Optional oldType = getEntityData(entityType);if (!oldType.isPresent()) { ViaBackwards.getPlatform().getLogger().warning("Could not find 1.13.2 entity type for 1.14 entity type " + type + "/" + entityType); + wrapper.cancel(); + }else{ + wrapper.set(Type.VAR_INT, 1, oldType.get().getReplacementId()); + } } else { wrapper.set(Type.VAR_INT, 1, oldId.get()); } @@ -297,6 +301,7 @@ public class EntityPackets1_14 extends EntityRewriter { regEntType(EntityType1_14.EntityType.FOX, EntityType1_14.EntityType.WOLF).mobName("Fox"); regEntType(EntityType1_14.EntityType.PANDA, EntityType1_14.EntityType.POLAR_BEAR).mobName("Panda"); regEntType(EntityType1_14.EntityType.PILLAGER, EntityType1_14.EntityType.VILLAGER).mobName("Pillager"); + regEntType(EntityType1_14.EntityType.WANDERING_TRADER, EntityType1_14.EntityType.VILLAGER).mobName("Wandering Trader"); regEntType(EntityType1_14.EntityType.RAVAGER, EntityType1_14.EntityType.COW).mobName("Ravager"); registerMetaHandler().handle(e -> {