3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-03 14:50:30 +01:00

Merge pull request #1314 from creeper123123321/master

Send set view distance on server change - not tested
Dieser Commit ist enthalten in:
Myles 2019-05-01 17:01:39 +01:00 committet von GitHub
Commit a4ed1644f3
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -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) {