Fix `Mode.NONE` target invalidation

This commit is contained in:
Brady 2023-06-12 13:46:10 -05:00
parent c8a0ae9e10
commit ed34ae73c0
No known key found for this signature in database
GPG Key ID: 73A788379A197567
1 changed files with 4 additions and 1 deletions

View File

@ -58,11 +58,14 @@ public final class LookBehavior extends Behavior implements ILookBehavior {
@Override
public void onPlayerUpdate(PlayerUpdateEvent event) {
if (this.target == null || this.target.mode == Target.Mode.NONE) {
if (this.target == null) {
return;
}
switch (event.getState()) {
case PRE: {
if (this.target.mode == Target.Mode.NONE) {
return;
}
if (this.target.mode == Target.Mode.SERVER) {
this.prevRotation = new Rotation(ctx.player().rotationYaw, ctx.player().rotationPitch);
}