diff options
-rw-r--r-- | Essentials/src/net/ess3/Essentials.java | 14 | ||||
-rw-r--r-- | Essentials/src/net/ess3/ItemDb.java | 2 | ||||
-rw-r--r-- | Essentials/src/net/ess3/api/IPermission.java | 11 | ||||
-rw-r--r-- | Essentials/src/net/ess3/permissions/AbstractSuperpermsPermission.java | 19 | ||||
-rw-r--r-- | Essentials/src/net/ess3/permissions/Permissions.java | 8 |
5 files changed, 24 insertions, 30 deletions
diff --git a/Essentials/src/net/ess3/Essentials.java b/Essentials/src/net/ess3/Essentials.java index 56b59b47e..3e38a123e 100644 --- a/Essentials/src/net/ess3/Essentials.java +++ b/Essentials/src/net/ess3/Essentials.java @@ -17,23 +17,10 @@ */ package net.ess3; -import net.ess3.api.*; import net.ess3.api.server.Player; import net.ess3.api.server.IPlugin; import net.ess3.api.server.IServer; import net.ess3.api.server.World; -import net.ess3.backup.Backup; -import net.ess3.commands.EssentialsCommandHandler; -import net.ess3.economy.Economy; -import net.ess3.economy.Trade; -import net.ess3.economy.WorthHolder; -import net.ess3.economy.register.Methods; -import net.ess3.listener.*; -import net.ess3.ranks.RanksStorage; -import net.ess3.settings.SettingsHolder; -import net.ess3.settings.SpawnsHolder; -import net.ess3.user.UserMap; -import net.ess3.utils.ExecuteTimer; import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -41,7 +28,6 @@ import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import lombok.Getter; -import lombok.Getter; import static net.ess3.I18n._; import net.ess3.api.*; import net.ess3.backup.Backup; diff --git a/Essentials/src/net/ess3/ItemDb.java b/Essentials/src/net/ess3/ItemDb.java index a47286c3e..2159fd4e3 100644 --- a/Essentials/src/net/ess3/ItemDb.java +++ b/Essentials/src/net/ess3/ItemDb.java @@ -14,8 +14,6 @@ import net.ess3.api.IItemDb; import net.ess3.api.IUser; import net.ess3.permissions.Permissions; import net.ess3.storage.ManagedFile; -import org.bukkit.Material; -import org.bukkit.inventory.ItemStack; public class ItemDb implements IItemDb diff --git a/Essentials/src/net/ess3/api/IPermission.java b/Essentials/src/net/ess3/api/IPermission.java index 987f0b481..f210a890f 100644 --- a/Essentials/src/net/ess3/api/IPermission.java +++ b/Essentials/src/net/ess3/api/IPermission.java @@ -1,17 +1,16 @@ package net.ess3.api; -import org.bukkit.command.CommandSender; -import org.bukkit.permissions.Permission; -import org.bukkit.permissions.PermissionDefault; +import net.ess3.api.server.CommandSender; +import net.ess3.api.server.Permission; public interface IPermission { - String getPermission(); + String getPermissionName(); boolean isAuthorized(CommandSender sender); - Permission getBukkitPermission(); + Permission getPermission(); - PermissionDefault getPermissionDefault(); + Permission.Default getPermissionDefault(); } diff --git a/Essentials/src/net/ess3/permissions/AbstractSuperpermsPermission.java b/Essentials/src/net/ess3/permissions/AbstractSuperpermsPermission.java index 211ce53aa..327299b99 100644 --- a/Essentials/src/net/ess3/permissions/AbstractSuperpermsPermission.java +++ b/Essentials/src/net/ess3/permissions/AbstractSuperpermsPermission.java @@ -1,18 +1,19 @@ package net.ess3.permissions; import net.ess3.api.IPermission; +import net.ess3.api.server.CommandSender; +import net.ess3.api.server.Permission; import net.ess3.utils.Util; -import org.bukkit.command.CommandSender; -import org.bukkit.permissions.Permission; -import org.bukkit.permissions.PermissionDefault; public abstract class AbstractSuperpermsPermission implements IPermission { + //todo - sort all this out protected Permission bukkitPerm; + @Override - public Permission getBukkitPermission() + public Permission getPermission() { if (bukkitPerm != null) { @@ -20,7 +21,7 @@ public abstract class AbstractSuperpermsPermission implements IPermission } else { - return Util.registerPermission(getPermission(), getPermissionDefault()); + return null;// Util.registerPermission(getPermission(), getPermissionDefault()); } } @@ -28,15 +29,17 @@ public abstract class AbstractSuperpermsPermission implements IPermission * PermissionDefault is OP, if the method is not overwritten. * @return */ + @Override - public PermissionDefault getPermissionDefault() + public Permission.Default getPermissionDefault() { - return PermissionDefault.OP; + return Permission.Default.OP; } + @Override public boolean isAuthorized(final CommandSender sender) { - return sender.hasPermission(getBukkitPermission()); + return sender.hasPermission(getPermission()); } } diff --git a/Essentials/src/net/ess3/permissions/Permissions.java b/Essentials/src/net/ess3/permissions/Permissions.java index 34fe88be4..f80a79f8d 100644 --- a/Essentials/src/net/ess3/permissions/Permissions.java +++ b/Essentials/src/net/ess3/permissions/Permissions.java @@ -1,6 +1,9 @@ package net.ess3.permissions; import java.util.Locale; +import net.ess3.api.IPermission; +import net.ess3.api.server.CommandSender; +import net.ess3.api.server.Permission; public enum Permissions implements IPermission @@ -106,6 +109,8 @@ public enum Permissions implements IPermission return permission; } + + @Override public Permission getPermission() { @@ -119,15 +124,18 @@ public enum Permissions implements IPermission } } + @Override public Permission.Default getPermissionDefault() { return this.defaultPerm; } + @Override public boolean isAuthorized(CommandSender sender) { return sender.hasPermission(getPermission()); } } + |