diff --git a/src/main/java/net/raphimc/vialegacy/protocol/classic/c0_28_30toa1_0_15/storage/ClassicOpLevelStorage.java b/src/main/java/net/raphimc/vialegacy/protocol/classic/c0_28_30toa1_0_15/storage/ClassicOpLevelStorage.java index c388737..c39a096 100644 --- a/src/main/java/net/raphimc/vialegacy/protocol/classic/c0_28_30toa1_0_15/storage/ClassicOpLevelStorage.java +++ b/src/main/java/net/raphimc/vialegacy/protocol/classic/c0_28_30toa1_0_15/storage/ClassicOpLevelStorage.java @@ -83,14 +83,12 @@ public void updateHax(final boolean flying, final boolean noClip, final boolean } public void setOpLevel(final byte opLevel) { - final boolean changed = this.opLevel != opLevel; this.opLevel = opLevel; if (this.haxEnabled) { final ClassicServerTitleStorage serverTitleStorage = this.getUser().get(ClassicServerTitleStorage.class); - this.updateHax(serverTitleStorage.isFlyEffectivelyEnabled(), serverTitleStorage.isNoclipEffectivelyEnabled(), serverTitleStorage.isSpeedEffectivelyEnabled(), serverTitleStorage.isRespawnEffectivelyEnabled()); - if (changed) { - this.updateAbilities(); + if (serverTitleStorage != null) { // Some servers update the op level before sending the login packet. Just ignore that because the op level is resent in the login packet. + this.updateHax(serverTitleStorage.isFlyEffectivelyEnabled(), serverTitleStorage.isNoclipEffectivelyEnabled(), serverTitleStorage.isSpeedEffectivelyEnabled(), serverTitleStorage.isRespawnEffectivelyEnabled()); } } }