From d113e11c3ba38e82a512522c0f8d86860aacae5b Mon Sep 17 00:00:00 2001 From: Matsv Date: Thu, 8 Jun 2017 19:35:26 +0200 Subject: [PATCH] Metadata change voor illagers (Should be changed @ wiki.vg) --- .../viabackwards/api/entities/types/EntityType1_12.java | 5 +++-- .../protocol/protocol1_10to1_11/packets/EntityPackets.java | 2 +- .../protocol1_12to1_11_1/packets/EntityPackets1_12.java | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/nl/matsv/viabackwards/api/entities/types/EntityType1_12.java b/core/src/main/java/nl/matsv/viabackwards/api/entities/types/EntityType1_12.java index bf76204e..ec814273 100644 --- a/core/src/main/java/nl/matsv/viabackwards/api/entities/types/EntityType1_12.java +++ b/core/src/main/java/nl/matsv/viabackwards/api/entities/types/EntityType1_12.java @@ -69,10 +69,11 @@ public class EntityType1_12 { ENTITY_HUMAN(-1, ENTITY_LIVING), ARMOR_STAND(30, ENTITY_LIVING), - EVOCATION_ILLAGER(34, ENTITY_INSENTIENT), + ENTITY_ILLAGER_ABSTRACT(-1, ENTITY_INSENTIENT), + EVOCATION_ILLAGER(34, ENTITY_ILLAGER_ABSTRACT), VEX(35, ENTITY_INSENTIENT), VINDICATION_ILLAGER(36, ENTITY_INSENTIENT), - ILLUSION_ILLAGER(37, EVOCATION_ILLAGER), + ILLUSION_ILLAGER(37, ENTITY_ILLAGER_ABSTRACT), // Vehicles MINECART_ABSTRACT(-1, ENTITY), diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/packets/EntityPackets.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/packets/EntityPackets.java index 7ef918ad..91dc8e29 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/packets/EntityPackets.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/packets/EntityPackets.java @@ -460,7 +460,7 @@ public class EntityPackets extends EntityRewriter { data.setId(13); data.setMetaType(MetaType1_9.VarInt); - data.setValue((byte) data.getValue() == 1 ? 2 : 4); + data.setValue((int) data.getValue() == 1 ? 2 : 4); return data; }); diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12to1_11_1/packets/EntityPackets1_12.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12to1_11_1/packets/EntityPackets1_12.java index 8b9df921..98f65530 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12to1_11_1/packets/EntityPackets1_12.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12to1_11_1/packets/EntityPackets1_12.java @@ -344,6 +344,10 @@ public class EntityPackets1_12 extends EntityRewriter { regEntType(EntityType.PARROT, EntityType.BAT).spawnMetadata(storage -> storage.add(new Metadata(12, MetaType1_12.Byte, (byte) 0x00))); regEntType(EntityType.ILLUSION_ILLAGER, EntityType.EVOCATION_ILLAGER); + // Handle Illager TODO wtf does this metadata do? + registerMetaHandler().filter(EntityType.ENTITY_ILLAGER_ABSTRACT, true, 12).removed(); + registerMetaHandler().filter(EntityType.ENTITY_ILLAGER_ABSTRACT, true, 13).handleIndexChange(12); + // Parrot remove animal metadata registerMetaHandler().filter(EntityType.PARROT, 12).removed(); // Is baby registerMetaHandler().filter(EntityType.PARROT, 13).removed(); // Flags (Is sitting etc, might be useful in the future (bat inactive TODO do more research about this entity)