Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-26 00:00:28 +01:00
Don't send pose to the client entity
Dieser Commit ist enthalten in:
Ursprung
61b5c90aa7
Commit
6d8a763f4c
@ -54,6 +54,7 @@ public class MetadataRewriter {
|
||||
}
|
||||
|
||||
if (type.isOrHasParent(Entity1_14Types.EntityType.PLAYER)) {
|
||||
if (entityId != tracker.getClientEntityId()) {
|
||||
if (metadata.getId() == 0) {
|
||||
byte flags = ((Number) metadata.getValue()).byteValue();
|
||||
// Mojang overrides the client-side pose updater, see OtherPlayerEntity#updateSize
|
||||
@ -64,6 +65,7 @@ public class MetadataRewriter {
|
||||
if (metadata.getId() == 0 || metadata.getId() == 7) {
|
||||
metadatas.add(new Metadata(6, MetaType1_14.Pose, recalculatePlayerPose(entityId, tracker)));
|
||||
}
|
||||
}
|
||||
} else if (type.isOrHasParent(Entity1_14Types.EntityType.ZOMBIE)) {
|
||||
if (metadata.getId() == 16) {
|
||||
tracker.setInsentientData(entityId, (byte) ((tracker.getInsentientData(entityId) & ~0x4)
|
||||
|
@ -202,7 +202,9 @@ public class EntityPackets {
|
||||
PacketWrapper metadataPacket = wrapper.create(0x43);
|
||||
metadataPacket.write(Type.VAR_INT, entityId);
|
||||
List<Metadata> metadataList = new LinkedList<>();
|
||||
if (tracker.getClientEntityId() != entityId) {
|
||||
metadataList.add(new Metadata(6, MetaType1_14.Pose, MetadataRewriter.recalculatePlayerPose(entityId, tracker)));
|
||||
}
|
||||
metadataList.add(new Metadata(12, MetaType1_14.OptPosition, null));
|
||||
metadataPacket.write(Types1_14.METADATA_LIST, metadataList);
|
||||
metadataPacket.send(Protocol1_14To1_13_2.class);
|
||||
@ -227,7 +229,9 @@ public class EntityPackets {
|
||||
Position position = wrapper.read(Type.POSITION);
|
||||
List<Metadata> metadataList = new LinkedList<>();
|
||||
metadataList.add(new Metadata(12, MetaType1_14.OptPosition, position));
|
||||
if (tracker.getClientEntityId() != entityId) {
|
||||
metadataList.add(new Metadata(6, MetaType1_14.Pose, MetadataRewriter.recalculatePlayerPose(entityId, tracker)));
|
||||
}
|
||||
wrapper.write(Types1_14.METADATA_LIST, metadataList);
|
||||
}
|
||||
});
|
||||
|
@ -302,7 +302,9 @@ public class WorldPackets {
|
||||
|
||||
Entity1_14Types.EntityType entType = Entity1_14Types.EntityType.PLAYER;
|
||||
// Register Type ID
|
||||
wrapper.user().get(EntityTracker.class).addEntity(entityId, entType);
|
||||
EntityTracker tracker = wrapper.user().get(EntityTracker.class);
|
||||
tracker.addEntity(entityId, entType);
|
||||
tracker.setClientEntityId(entityId);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -22,6 +22,9 @@ public class EntityTracker extends StoredObject implements ExternalJoinGameListe
|
||||
private int latestTradeWindowId;
|
||||
@Getter
|
||||
@Setter
|
||||
private int clientEntityId;
|
||||
@Getter
|
||||
@Setter
|
||||
private boolean forceSendCenterChunk = true;
|
||||
@Getter
|
||||
@Setter
|
||||
@ -92,6 +95,7 @@ public class EntityTracker extends StoredObject implements ExternalJoinGameListe
|
||||
|
||||
@Override
|
||||
public void onExternalJoinGame(int playerEntityId) {
|
||||
clientEntityId = playerEntityId;
|
||||
clientEntityTypes.put(playerEntityId, Entity1_14Types.EntityType.PLAYER);
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren