Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-26 16:12:42 +01:00
Send set view distance on server change - not tested
Dieser Commit ist enthalten in:
Ursprung
b04acf98c7
Commit
ad12866bf4
@ -3,10 +3,14 @@ package us.myles.ViaVersion.protocols.protocol1_14to1_13_2.storage;
|
|||||||
import com.google.common.base.Optional;
|
import com.google.common.base.Optional;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import us.myles.ViaVersion.api.PacketWrapper;
|
||||||
import us.myles.ViaVersion.api.data.ExternalJoinGameListener;
|
import us.myles.ViaVersion.api.data.ExternalJoinGameListener;
|
||||||
import us.myles.ViaVersion.api.data.StoredObject;
|
import us.myles.ViaVersion.api.data.StoredObject;
|
||||||
import us.myles.ViaVersion.api.data.UserConnection;
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
import us.myles.ViaVersion.api.entities.Entity1_14Types;
|
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.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
@ -97,6 +101,13 @@ public class EntityTracker extends StoredObject implements ExternalJoinGameListe
|
|||||||
public void onExternalJoinGame(int playerEntityId) {
|
public void onExternalJoinGame(int playerEntityId) {
|
||||||
clientEntityId = playerEntityId;
|
clientEntityId = playerEntityId;
|
||||||
clientEntityTypes.put(playerEntityId, Entity1_14Types.EntityType.PLAYER);
|
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) {
|
public byte getEntityFlags(int player) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren