From 1cb3b985a7ce333c715706229d2df71b2e049f2b Mon Sep 17 00:00:00 2001 From: Myles Date: Wed, 7 Jun 2017 15:13:04 +0100 Subject: [PATCH] Fix hologram patch not working on 1.12 --- .../protocol1_9to1_8/storage/EntityTracker.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/EntityTracker.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/EntityTracker.java index 53489b689..d8f952987 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/EntityTracker.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/EntityTracker.java @@ -3,7 +3,6 @@ package us.myles.ViaVersion.protocols.protocol1_9to1_8.storage; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import com.google.common.collect.Sets; -import io.netty.buffer.ByteBuf; import lombok.Getter; import lombok.Setter; import us.myles.ViaVersion.api.PacketWrapper; @@ -25,7 +24,6 @@ import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9TO1_8; import us.myles.ViaVersion.protocols.protocol1_9to1_8.chat.GameMode; import us.myles.ViaVersion.protocols.protocol1_9to1_8.metadata.MetadataRewriter; import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.BossBarProvider; -import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.BulkChunkTranslatorProvider; import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.EntityIdProvider; import java.util.*; @@ -182,14 +180,13 @@ public class EntityTracker extends StoredObject { knownHolograms.add(entityID); try { // Send movement - ByteBuf buf = getUser().getChannel().alloc().buffer(); - Type.VAR_INT.write(buf, 0x25); // Relative Move Packet - Type.VAR_INT.write(buf, entityID); - buf.writeShort(0); - buf.writeShort((short) (128D * (Via.getConfig().getHologramYOffset() * 32D))); - buf.writeShort(0); - buf.writeBoolean(true); - getUser().sendRawPacket(buf, false); + PacketWrapper wrapper = new PacketWrapper(0x25, null, getUser()); + wrapper.write(Type.VAR_INT, entityID); + wrapper.write(Type.SHORT, (short) 0); + wrapper.write(Type.SHORT, (short) (128D * (Via.getConfig().getHologramYOffset() * 32D))); + wrapper.write(Type.SHORT, (short) 0); + wrapper.write(Type.BOOLEAN, true); + wrapper.send(Protocol1_9TO1_8.class, true, false); } catch (Exception ignored) { } }