diff --git a/server/src/main/java/dev/plex/command/PlexCommand.java b/server/src/main/java/dev/plex/command/PlexCommand.java index 5ee910a..e6ae4ef 100644 --- a/server/src/main/java/dev/plex/command/PlexCommand.java +++ b/server/src/main/java/dev/plex/command/PlexCommand.java @@ -151,7 +151,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC } else if (plugin.getSystem().equalsIgnoreCase("permissions")) { - if (!player.hasPermission(perms.permission())) + if (!perms.permission().isEmpty() && !player.hasPermission(perms.permission())) { send(sender, messageComponent("noPermissionNode", perms.permission())); return true; @@ -187,7 +187,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC } else if (plugin.getSystem().equalsIgnoreCase("permissions")) { - if (!plugin.getPermissions().playerHas(null, Bukkit.getOfflinePlayer(plexPlayer.getUuid()), perms.permission())) + if (!perms.permission().isEmpty() && !plugin.getPermissions().playerHas(null, Bukkit.getOfflinePlayer(plexPlayer.getUuid()), perms.permission())) { send(sender, messageComponent("noPermissionNode", perms.permission())); return true; @@ -306,7 +306,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC } else if (plugin.getSystem().equalsIgnoreCase("permissions")) { - if (!plugin.getPermissions().playerHas(null, Bukkit.getOfflinePlayer(plexPlayer.getUuid()), permission)) + if (!perms.permission().isEmpty() && !plugin.getPermissions().playerHas(null, Bukkit.getOfflinePlayer(plexPlayer.getUuid()), permission)) { throw new CommandFailException(PlexUtils.messageString("noPermissionNode", permission)); } @@ -344,7 +344,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC } else if (plugin.getSystem().equalsIgnoreCase("permissions")) { - if (!player.hasPermission(permission)) + if (!perms.permission().isEmpty() && !player.hasPermission(permission)) { throw new CommandFailException(PlexUtils.messageString("noPermissionNode", permission)); } @@ -365,7 +365,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC } else if (plugin.getSystem().equalsIgnoreCase("permissions")) { - return player.hasPermission(permission); + return !perms.permission().isEmpty() && player.hasPermission(permission); } return false; } @@ -406,7 +406,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC } else if (plugin.getSystem().equalsIgnoreCase("permissions")) { - return player.hasPermission(permission); + return !perms.permission().isEmpty() && player.hasPermission(permission); } return true; } diff --git a/server/src/main/java/dev/plex/command/impl/PlexCMD.java b/server/src/main/java/dev/plex/command/impl/PlexCMD.java index 19a793b..33189aa 100644 --- a/server/src/main/java/dev/plex/command/impl/PlexCMD.java +++ b/server/src/main/java/dev/plex/command/impl/PlexCMD.java @@ -22,7 +22,7 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -@CommandPermissions(level = Rank.OP, permission = "plex.plex", source = RequiredCommandSource.ANY) +@CommandPermissions(level = Rank.IMPOSTOR, source = RequiredCommandSource.ANY) @CommandParameters(name = "plex", usage = "/ [reload | redis | modules [reload]]", description = "Show information about Plex or reload it") public class PlexCMD extends PlexCommand { diff --git a/server/src/main/java/dev/plex/command/impl/TFMCMD.java b/server/src/main/java/dev/plex/command/impl/TFMCMD.java index 9744cdc..b477e69 100644 --- a/server/src/main/java/dev/plex/command/impl/TFMCMD.java +++ b/server/src/main/java/dev/plex/command/impl/TFMCMD.java @@ -16,8 +16,8 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -@CommandParameters(name = "totalfreedommod", usage = "/", description = "You can't simpy do that.", aliases = "tfm") -@CommandPermissions(level = Rank.OP, permission = "plex.tfm", source = RequiredCommandSource.ANY) +@CommandParameters(name = "totalfreedommod", description = "You can't simpy do that.", aliases = "tfm") +@CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY) public class TFMCMD extends PlexCommand { @@ -35,7 +35,6 @@ public class TFMCMD extends PlexCommand pageComponents.add(PlexUtils.mmDeserialize("" + page + "")); } - playerSender.openBook(Book.builder() .title(Component.text("TFM License")) .author(Component.text("Prozza"))