Add Override annotations where appropriate

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2019-04-28 11:37:52 +10:00
parent d66310a2f1
commit 82854b7bd7
176 changed files with 503 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ public class PermissibleBase implements Permissible {
recalculatePermissions();
}
@Override
public boolean isOp() {
if (opable == null) {
return false;
@@ -39,6 +40,7 @@ public class PermissibleBase implements Permissible {
}
}
@Override
public void setOp(boolean value) {
if (opable == null) {
throw new UnsupportedOperationException("Cannot change op value as no ServerOperator is set");
@@ -47,6 +49,7 @@ public class PermissibleBase implements Permissible {
}
}
@Override
public boolean isPermissionSet(@NotNull String name) {
if (name == null) {
throw new IllegalArgumentException("Permission name cannot be null");
@@ -55,6 +58,7 @@ public class PermissibleBase implements Permissible {
return permissions.containsKey(name.toLowerCase(java.util.Locale.ENGLISH));
}
@Override
public boolean isPermissionSet(@NotNull Permission perm) {
if (perm == null) {
throw new IllegalArgumentException("Permission cannot be null");
@@ -63,6 +67,7 @@ public class PermissibleBase implements Permissible {
return isPermissionSet(perm.getName());
}
@Override
public boolean hasPermission(@NotNull String inName) {
if (inName == null) {
throw new IllegalArgumentException("Permission name cannot be null");
@@ -83,6 +88,7 @@ public class PermissibleBase implements Permissible {
}
}
@Override
public boolean hasPermission(@NotNull Permission perm) {
if (perm == null) {
throw new IllegalArgumentException("Permission cannot be null");
@@ -96,6 +102,7 @@ public class PermissibleBase implements Permissible {
return perm.getDefault().getValue(isOp());
}
@Override
@NotNull
public PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value) {
if (name == null) {
@@ -114,6 +121,7 @@ public class PermissibleBase implements Permissible {
return result;
}
@Override
@NotNull
public PermissionAttachment addAttachment(@NotNull Plugin plugin) {
if (plugin == null) {
@@ -130,6 +138,7 @@ public class PermissibleBase implements Permissible {
return result;
}
@Override
public void removeAttachment(@NotNull PermissionAttachment attachment) {
if (attachment == null) {
throw new IllegalArgumentException("Attachment cannot be null");
@@ -149,6 +158,7 @@ public class PermissibleBase implements Permissible {
}
}
@Override
public void recalculatePermissions() {
clearPermissions();
Set<Permission> defaults = Bukkit.getServer().getPluginManager().getDefaultPermissions(isOp());
@@ -196,6 +206,7 @@ public class PermissibleBase implements Permissible {
}
}
@Override
@Nullable
public PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value, int ticks) {
if (name == null) {
@@ -215,6 +226,7 @@ public class PermissibleBase implements Permissible {
return result;
}
@Override
@Nullable
public PermissionAttachment addAttachment(@NotNull Plugin plugin, int ticks) {
if (plugin == null) {
@@ -234,6 +246,7 @@ public class PermissibleBase implements Permissible {
}
}
@Override
@NotNull
public Set<PermissionAttachmentInfo> getEffectivePermissions() {
return new HashSet<PermissionAttachmentInfo>(permissions.values());
@@ -246,6 +259,7 @@ public class PermissibleBase implements Permissible {
this.attachment = attachment;
}
@Override
public void run() {
attachment.remove();
}