From ad12866bf4f81b85831e4371301056ba8c9cf4b5 Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Wed, 1 May 2019 12:52:42 -0300 Subject: [PATCH] Send set view distance on server change - not tested --- .../protocol1_14to1_13_2/storage/EntityTracker.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/storage/EntityTracker.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/storage/EntityTracker.java index 0c8768098..1cd3e2dc6 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/storage/EntityTracker.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/storage/EntityTracker.java @@ -3,10 +3,14 @@ package us.myles.ViaVersion.protocols.protocol1_14to1_13_2.storage; import com.google.common.base.Optional; import lombok.Getter; import lombok.Setter; +import us.myles.ViaVersion.api.PacketWrapper; import us.myles.ViaVersion.api.data.ExternalJoinGameListener; import us.myles.ViaVersion.api.data.StoredObject; import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.entities.Entity1_14Types; +import us.myles.ViaVersion.api.type.Type; +import us.myles.ViaVersion.protocols.protocol1_14to1_13_2.Protocol1_14To1_13_2; +import us.myles.ViaVersion.protocols.protocol1_14to1_13_2.packets.WorldPackets; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -97,6 +101,13 @@ public class EntityTracker extends StoredObject implements ExternalJoinGameListe public void onExternalJoinGame(int playerEntityId) { clientEntityId = playerEntityId; clientEntityTypes.put(playerEntityId, Entity1_14Types.EntityType.PLAYER); + PacketWrapper setViewDistance = new PacketWrapper(0x41, null, getUser()); + setViewDistance.write(Type.VAR_INT, WorldPackets.SERVERSIDE_VIEW_DISTANCE); + try { + setViewDistance.send(Protocol1_14To1_13_2.class, true, true); + } catch (Exception e) { + e.printStackTrace(); + } } public byte getEntityFlags(int player) {