Small documentation fixes

This commit is contained in:
Alexander Söderberg 2020-07-05 18:06:10 +02:00
parent dc0358957e
commit 4d61a345c6
No known key found for this signature in database
GPG Key ID: C0207FF7EA146678
4 changed files with 26 additions and 9 deletions

View File

@ -164,7 +164,7 @@ public class BukkitPlayer extends PlotPlayer<Player> {
}
}
@Override public boolean hasPermission(final String permission) {
@Override public boolean hasPermission(@NotNull final String permission) {
if (this.offline && EconHandler.getEconHandler() != null) {
return EconHandler.getEconHandler().hasPermission(getName(), permission);
}
@ -231,7 +231,7 @@ public class BukkitPlayer extends PlotPlayer<Player> {
return max;
}
@Override public boolean isPermissionSet(final String permission) {
@Override public boolean isPermissionSet(@NotNull final String permission) {
return this.player.isPermissionSet(permission);
}

View File

@ -29,6 +29,10 @@ import com.plotsquared.core.configuration.Caption;
import net.kyori.adventure.text.minimessage.Template;
import org.jetbrains.annotations.NotNull;
/**
* Any entity that is able to execute commands, receive messages &amp; and have
* permission nodes
*/
public interface CommandCaller {
/**
@ -44,9 +48,22 @@ public interface CommandCaller {
*
* @param permission the name of the permission
*/
boolean hasPermission(String permission);
boolean hasPermission(@NotNull String permission);
boolean isPermissionSet(String permission);
/**
* Checks if this object contains an override for the specified
* permission, by fully qualified name
*
* @param permission Name of the permission
* @return true if the permission is set, otherwise false
*/
boolean isPermissionSet(@NotNull String permission);
/**
* Get the type of the caller
*
* @return Caller type
*/
@NotNull RequiredType getSuperCaller();
RequiredType getSuperCaller();
}

View File

@ -99,11 +99,11 @@ public class ConsolePlayer extends PlotPlayer<Actor> {
return 0;
}
@Override public boolean hasPermission(String permission) {
@Override public boolean hasPermission(@NotNull String permission) {
return true;
}
@Override public boolean isPermissionSet(String permission) {
@Override public boolean isPermissionSet(@NotNull String permission) {
return true;
}
@ -137,7 +137,7 @@ public class ConsolePlayer extends PlotPlayer<Actor> {
@Override public void removeAttribute(String key) {
}
@Override public RequiredType getSuperCaller() {
@Override @NotNull public RequiredType getSuperCaller() {
return RequiredType.CONSOLE;
}

View File

@ -361,7 +361,7 @@ public abstract class PlotPlayer<P> implements CommandCaller, OfflinePlotPlayer,
return PlotSquared.get().getApplicablePlotArea(getLocation());
}
@Override public RequiredType getSuperCaller() {
@Override @NotNull public RequiredType getSuperCaller() {
return RequiredType.PLAYER;
}