mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-09-30 23:57:30 +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;
|
return offlinePlayer != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
public CommandSender getSender() {
|
public CommandSender getSender() {
|
||||||
return sender;
|
return sender;
|
||||||
}
|
}
|
||||||
@ -233,10 +234,10 @@ public class User {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param permission permission string
|
* @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) {
|
public boolean hasPermission(@Nullable String permission) {
|
||||||
return permission.isEmpty() || isOp() || sender.hasPermission(permission);
|
return permission == null || permission.isEmpty() || isOp() || sender.hasPermission(permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user