mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-23 01:27:37 +00:00
Allow not setting permissions
This commit is contained in:
parent
74faaf2d74
commit
fd50589331
@ -151,7 +151,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
|
|||||||
}
|
}
|
||||||
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
|
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()));
|
send(sender, messageComponent("noPermissionNode", perms.permission()));
|
||||||
return true;
|
return true;
|
||||||
@ -187,7 +187,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
|
|||||||
}
|
}
|
||||||
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
|
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()));
|
send(sender, messageComponent("noPermissionNode", perms.permission()));
|
||||||
return true;
|
return true;
|
||||||
@ -306,7 +306,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
|
|||||||
}
|
}
|
||||||
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
|
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));
|
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"))
|
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
|
||||||
{
|
{
|
||||||
if (!player.hasPermission(permission))
|
if (!perms.permission().isEmpty() && !player.hasPermission(permission))
|
||||||
{
|
{
|
||||||
throw new CommandFailException(PlexUtils.messageString("noPermissionNode", 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"))
|
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
|
||||||
{
|
{
|
||||||
return player.hasPermission(permission);
|
return !perms.permission().isEmpty() && player.hasPermission(permission);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -406,7 +406,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
|
|||||||
}
|
}
|
||||||
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
|
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
|
||||||
{
|
{
|
||||||
return player.hasPermission(permission);
|
return !perms.permission().isEmpty() && player.hasPermission(permission);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
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 = "/<command> [reload | redis | modules [reload]]", description = "Show information about Plex or reload it")
|
@CommandParameters(name = "plex", usage = "/<command> [reload | redis | modules [reload]]", description = "Show information about Plex or reload it")
|
||||||
public class PlexCMD extends PlexCommand
|
public class PlexCMD extends PlexCommand
|
||||||
{
|
{
|
||||||
|
@ -16,8 +16,8 @@ import org.bukkit.entity.Player;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@CommandParameters(name = "totalfreedommod", usage = "/<command>", description = "You can't simpy do that.", aliases = "tfm")
|
@CommandParameters(name = "totalfreedommod", description = "You can't simpy do that.", aliases = "tfm")
|
||||||
@CommandPermissions(level = Rank.OP, permission = "plex.tfm", source = RequiredCommandSource.ANY)
|
@CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY)
|
||||||
|
|
||||||
public class TFMCMD extends PlexCommand
|
public class TFMCMD extends PlexCommand
|
||||||
{
|
{
|
||||||
@ -35,7 +35,6 @@ public class TFMCMD extends PlexCommand
|
|||||||
pageComponents.add(PlexUtils.mmDeserialize("<rainbow>" + page + "</rainbow>"));
|
pageComponents.add(PlexUtils.mmDeserialize("<rainbow>" + page + "</rainbow>"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
playerSender.openBook(Book.builder()
|
playerSender.openBook(Book.builder()
|
||||||
.title(Component.text("TFM License"))
|
.title(Component.text("TFM License"))
|
||||||
.author(Component.text("Prozza"))
|
.author(Component.text("Prozza"))
|
||||||
|
Loading…
Reference in New Issue
Block a user