From f391cc6185b8b3d8a80f81d1e52315c5de1b34d1 Mon Sep 17 00:00:00 2001 From: KennyTV Date: Tue, 23 Jun 2020 17:30:37 +0200 Subject: [PATCH] Send impact_projectiles enttiy tag --- .../us/myles/ViaVersion/api/rewriters/TagRewriter.java | 8 +++++--- .../protocol1_16to1_15_2/Protocol1_16To1_15_2.java | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/api/rewriters/TagRewriter.java b/common/src/main/java/us/myles/ViaVersion/api/rewriters/TagRewriter.java index 301c61727..f9667e65c 100644 --- a/common/src/main/java/us/myles/ViaVersion/api/rewriters/TagRewriter.java +++ b/common/src/main/java/us/myles/ViaVersion/api/rewriters/TagRewriter.java @@ -17,7 +17,8 @@ public class TagRewriter { private final IdRewriteFunction entityRewriter; private final List newBlockTags = new ArrayList<>(); private final List newItemTags = new ArrayList<>(); - // add fluid or entity tag lists if needed at some point + private final List newEntityTags = new ArrayList<>(); + // add fluid tag list if needed at some point public TagRewriter(Protocol protocol, IdRewriteFunction blockRewriter, IdRewriteFunction itemRewriter, IdRewriteFunction entityRewriter) { this.protocol = protocol; @@ -51,7 +52,7 @@ public class TagRewriter { handle(wrapper, blockRewriter, newBlockTags); handle(wrapper, itemRewriter, newItemTags); - if (entityRewriter == null) return; + if (entityRewriter == null && newEntityTags.isEmpty()) return; int fluidTagsSize = wrapper.passthrough(Type.VAR_INT); for (int i = 0; i < fluidTagsSize; i++) { @@ -59,7 +60,7 @@ public class TagRewriter { wrapper.passthrough(Type.VAR_INT_ARRAY_PRIMITIVE); } - handle(wrapper, entityRewriter, null); + handle(wrapper, entityRewriter, newEntityTags); }); } }); @@ -95,6 +96,7 @@ public class TagRewriter { case ITEM: return newItemTags; case ENTITY: + return newEntityTags; case FLUID: default: return null; diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16to1_15_2/Protocol1_16To1_15_2.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16to1_15_2/Protocol1_16To1_15_2.java index 6f486d614..e44bc5cf2 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16to1_15_2/Protocol1_16To1_15_2.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16to1_15_2/Protocol1_16To1_15_2.java @@ -172,6 +172,8 @@ public class Protocol1_16To1_15_2 extends Protocol