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,15 +54,17 @@ public class MetadataRewriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (type.isOrHasParent(Entity1_14Types.EntityType.PLAYER)) {
|
if (type.isOrHasParent(Entity1_14Types.EntityType.PLAYER)) {
|
||||||
if (metadata.getId() == 0) {
|
if (entityId != tracker.getClientEntityId()) {
|
||||||
byte flags = ((Number) metadata.getValue()).byteValue();
|
if (metadata.getId() == 0) {
|
||||||
// Mojang overrides the client-side pose updater, see OtherPlayerEntity#updateSize
|
byte flags = ((Number) metadata.getValue()).byteValue();
|
||||||
tracker.setEntityFlags(entityId, flags);
|
// Mojang overrides the client-side pose updater, see OtherPlayerEntity#updateSize
|
||||||
} else if (metadata.getId() == 7) {
|
tracker.setEntityFlags(entityId, flags);
|
||||||
tracker.setRiptide(entityId, (((Number) metadata.getValue()).byteValue() & 0x4) != 0);
|
} else if (metadata.getId() == 7) {
|
||||||
}
|
tracker.setRiptide(entityId, (((Number) metadata.getValue()).byteValue() & 0x4) != 0);
|
||||||
if (metadata.getId() == 0 || metadata.getId() == 7) {
|
}
|
||||||
metadatas.add(new Metadata(6, MetaType1_14.Pose, recalculatePlayerPose(entityId, tracker)));
|
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)) {
|
} else if (type.isOrHasParent(Entity1_14Types.EntityType.ZOMBIE)) {
|
||||||
if (metadata.getId() == 16) {
|
if (metadata.getId() == 16) {
|
||||||
|
@ -202,7 +202,9 @@ public class EntityPackets {
|
|||||||
PacketWrapper metadataPacket = wrapper.create(0x43);
|
PacketWrapper metadataPacket = wrapper.create(0x43);
|
||||||
metadataPacket.write(Type.VAR_INT, entityId);
|
metadataPacket.write(Type.VAR_INT, entityId);
|
||||||
List<Metadata> metadataList = new LinkedList<>();
|
List<Metadata> metadataList = new LinkedList<>();
|
||||||
metadataList.add(new Metadata(6, MetaType1_14.Pose, MetadataRewriter.recalculatePlayerPose(entityId, tracker)));
|
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));
|
metadataList.add(new Metadata(12, MetaType1_14.OptPosition, null));
|
||||||
metadataPacket.write(Types1_14.METADATA_LIST, metadataList);
|
metadataPacket.write(Types1_14.METADATA_LIST, metadataList);
|
||||||
metadataPacket.send(Protocol1_14To1_13_2.class);
|
metadataPacket.send(Protocol1_14To1_13_2.class);
|
||||||
@ -227,7 +229,9 @@ public class EntityPackets {
|
|||||||
Position position = wrapper.read(Type.POSITION);
|
Position position = wrapper.read(Type.POSITION);
|
||||||
List<Metadata> metadataList = new LinkedList<>();
|
List<Metadata> metadataList = new LinkedList<>();
|
||||||
metadataList.add(new Metadata(12, MetaType1_14.OptPosition, position));
|
metadataList.add(new Metadata(12, MetaType1_14.OptPosition, position));
|
||||||
metadataList.add(new Metadata(6, MetaType1_14.Pose, MetadataRewriter.recalculatePlayerPose(entityId, tracker)));
|
if (tracker.getClientEntityId() != entityId) {
|
||||||
|
metadataList.add(new Metadata(6, MetaType1_14.Pose, MetadataRewriter.recalculatePlayerPose(entityId, tracker)));
|
||||||
|
}
|
||||||
wrapper.write(Types1_14.METADATA_LIST, metadataList);
|
wrapper.write(Types1_14.METADATA_LIST, metadataList);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -302,7 +302,9 @@ public class WorldPackets {
|
|||||||
|
|
||||||
Entity1_14Types.EntityType entType = Entity1_14Types.EntityType.PLAYER;
|
Entity1_14Types.EntityType entType = Entity1_14Types.EntityType.PLAYER;
|
||||||
// Register Type ID
|
// 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;
|
private int latestTradeWindowId;
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
private int clientEntityId;
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
private boolean forceSendCenterChunk = true;
|
private boolean forceSendCenterChunk = true;
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@ -92,6 +95,7 @@ public class EntityTracker extends StoredObject implements ExternalJoinGameListe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onExternalJoinGame(int playerEntityId) {
|
public void onExternalJoinGame(int playerEntityId) {
|
||||||
|
clientEntityId = playerEntityId;
|
||||||
clientEntityTypes.put(playerEntityId, Entity1_14Types.EntityType.PLAYER);
|
clientEntityTypes.put(playerEntityId, Entity1_14Types.EntityType.PLAYER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren