mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-09-29 15:17:29 +02:00
Added nullability annotations on User#hasPermission() and User#getSender()
This commit is contained in:
parent
2ad661b11a
commit
acf87efd9b
@ -223,6 +223,7 @@ public class User {
|
||||
return offlinePlayer != null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public CommandSender getSender() {
|
||||
return sender;
|
||||
}
|
||||
@ -233,10 +234,10 @@ public class User {
|
||||
|
||||
/**
|
||||
* @param permission permission string
|
||||
* @return true if permission is empty or if the player has that permission or if the player is op.
|
||||
* @return true if permission is empty or null or if the player has that permission or if the player is op.
|
||||
*/
|
||||
public boolean hasPermission(String permission) {
|
||||
return permission.isEmpty() || isOp() || sender.hasPermission(permission);
|
||||
public boolean hasPermission(@Nullable String permission) {
|
||||
return permission == null || permission.isEmpty() || isOp() || sender.hasPermission(permission);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user