Skip to content

Commit

Permalink
don't reset oplevel on dimension changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AoElite committed Feb 9, 2024
1 parent d1dd0d2 commit 151311e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void onPacketSend(PacketSendEvent event) {
player.dimension = respawn.getDimension();

player.compensatedEntities.serverPlayerVehicle = null; // All entities get removed on respawn
player.compensatedEntities.playerEntity = new PacketEntitySelf(player);
player.compensatedEntities.playerEntity = new PacketEntitySelf(player, player.compensatedEntities.playerEntity);
player.compensatedEntities.selfTrackedEntity = new TrackerData(0, 0, 0, 0, 0, EntityTypes.PLAYER, player.lastTransactionSent.get());

if (player.getClientVersion().isOlderThan(ClientVersion.V_1_14)) { // 1.14+ players send a packet for this, listen for it instead
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ public PacketEntitySelf(GrimPlayer player) {
this.player = player;
}

public PacketEntitySelf(GrimPlayer player, PacketEntitySelf old) {
super(EntityTypes.PLAYER);
this.player = player;
this.opLevel = old.opLevel;
}

public boolean inVehicle() {
return getRiding() != null;
}
Expand Down

0 comments on commit 151311e

Please sign in to comment.