Skip to content

Commit

Permalink
Check if client entity id is set
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Sep 17, 2024
1 parent c785df5 commit 724a6b7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public void register() {
final EntityTracker1_8 tracker = wrapper.user().getEntityTracker(Protocol1_8To1_7_6_10.class);
tracker.addPlayer(entityId, wrapper.user().getProtocolInfo().getUuid());

tracker.setClientEntityId(entityId);
tracker.setClientEntityGameMode(wrapper.get(Types.UNSIGNED_BYTE, 0));

// Reset on Velocity server change
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void clearEntities() {

@Override
public void setClientEntityId(int entityId) {
if (this.spectatingClientEntityId == this.clientEntityId()) {
if (this.hasClientEntityId() && this.spectatingClientEntityId == this.clientEntityId()) {
this.spectatingClientEntityId = entityId;
}
super.setClientEntityId(entityId);
Expand Down

0 comments on commit 724a6b7

Please sign in to comment.