From 2c95229cfc218eba9c72dc5e20ac4a6c4bac2848 Mon Sep 17 00:00:00 2001 From: KennyTV <28825609+KennyTV@users.noreply.github.com> Date: Sat, 30 Nov 2019 19:22:36 +0100 Subject: [PATCH] Fix blaze remap and entity destroy in 1.15 Fixes #1542 --- .../api/entities/Entity1_15Types.java | 2 +- .../Protocol1_15To1_14_4.java | 2 +- .../packets/EntityPackets.java | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/api/entities/Entity1_15Types.java b/common/src/main/java/us/myles/ViaVersion/api/entities/Entity1_15Types.java index 2a5eb08b9..7f14b442a 100644 --- a/common/src/main/java/us/myles/ViaVersion/api/entities/Entity1_15Types.java +++ b/common/src/main/java/us/myles/ViaVersion/api/entities/Entity1_15Types.java @@ -102,7 +102,7 @@ public class Entity1_15Types { // Monsters ABSTRACT_MONSTER(-1, ABSTRACT_CREATURE), - BLAZE(4, ABSTRACT_MONSTER), + BLAZE(5, ABSTRACT_MONSTER), CREEPER(12, ABSTRACT_MONSTER), ENDERMITE(21, ABSTRACT_MONSTER), ENDERMAN(20, ABSTRACT_MONSTER), diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/Protocol1_15To1_14_4.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/Protocol1_15To1_14_4.java index 826ebd5d4..b098fdb97 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/Protocol1_15To1_14_4.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/Protocol1_15To1_14_4.java @@ -199,7 +199,7 @@ public class Protocol1_15To1_14_4 extends Protocol { registerOutgoing(State.PLAY, 0x34, 0x35); registerOutgoing(State.PLAY, 0x35, 0x36); registerOutgoing(State.PLAY, 0x36, 0x37); - registerOutgoing(State.PLAY, 0x37, 0x38); + registerOutgoing(State.PLAY, 0x38, 0x39); registerOutgoing(State.PLAY, 0x39, 0x3A); registerOutgoing(State.PLAY, 0x3B, 0x3C); diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/packets/EntityPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/packets/EntityPackets.java index 57638ac2b..582a3d93f 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/packets/EntityPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/packets/EntityPackets.java @@ -128,6 +128,23 @@ public class EntityPackets { }); } }); + + // Destroy entities + protocol.registerOutgoing(State.PLAY, 0x37, 0x38, new PacketRemapper() { + @Override + public void registerMap() { + map(Type.VAR_INT_ARRAY); + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + EntityTracker entityTracker = wrapper.user().get(EntityTracker.class); + for (int entity : wrapper.get(Type.VAR_INT_ARRAY, 0)) { + entityTracker.removeEntity(entity); + } + } + }); + } + }); } public static int getNewEntityId(int oldId) {