Skip to content

Commit

Permalink
Fix personal variables placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
imDaniX committed Jun 17, 2023
1 parent 6b9e575 commit 9e72ec1
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 @@ -87,6 +87,10 @@ public final boolean isInitialized() {
return Optional.ofNullable(variables);
}

public final boolean hasPlayer() {
return this.player != null;
}

public final @Nullable Player getPlayer() {
return this.player;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ public class PersistentVarPlaceholders implements Placeholder.Keyed {
}

case "varp": case "varplayer":
return env.getPlayer() == null ? ReActions.getVariables().getVariable(env.getPlayer().getName(), params) : null;
return env.getPlayer() != null
? ReActions.getVariables().getVariable(env.getPlayer().getName(), params)
: null;

default:
return null;
Expand Down

0 comments on commit 9e72ec1

Please sign in to comment.