mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-29 19:46:42 +00:00
staff -> admins
* rename everything containing staff back to admin (as requested by ryan i've renamed commands like slconfig to saconfig but left "slconfig" as an alias) * format almost every file correctly * a few other improvements
This commit is contained in:
@ -46,12 +46,12 @@ public class CommandBlocker extends FreedomService
|
||||
{
|
||||
try
|
||||
{
|
||||
SimplePluginManager simplePluginManager = (SimplePluginManager) Bukkit.getServer().getPluginManager();
|
||||
SimplePluginManager simplePluginManager = (SimplePluginManager)Bukkit.getServer().getPluginManager();
|
||||
|
||||
Field commandMapField = SimplePluginManager.class.getDeclaredField("commandMap");
|
||||
commandMapField.setAccessible(true);
|
||||
|
||||
SimpleCommandMap simpleCommandMap = (SimpleCommandMap) commandMapField.get(simplePluginManager);
|
||||
SimpleCommandMap simpleCommandMap = (SimpleCommandMap)commandMapField.get(simplePluginManager);
|
||||
return simpleCommandMap;
|
||||
}
|
||||
catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e)
|
||||
@ -171,7 +171,7 @@ public class CommandBlocker extends FreedomService
|
||||
|
||||
for (String part : commandParts)
|
||||
{
|
||||
if (command.startsWith("/") && !plugin.sl.isStaff(sender) && (part.contains("#copy") || part.contains("#clipboard")))
|
||||
if (command.startsWith("/") && !plugin.al.isAdmin(sender) && (part.contains("#copy") || part.contains("#clipboard")))
|
||||
{
|
||||
FUtil.playerMsg(sender, "WorldEdit copy variables are disabled.");
|
||||
return true;
|
||||
|
@ -8,7 +8,7 @@ public enum CommandBlockerAction
|
||||
BLOCK_UNKNOWN("u");
|
||||
private final String token;
|
||||
|
||||
private CommandBlockerAction(String token)
|
||||
CommandBlockerAction(String token)
|
||||
{
|
||||
this.token = token;
|
||||
}
|
||||
@ -29,4 +29,4 @@ public enum CommandBlockerAction
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -2,23 +2,20 @@ package me.totalfreedom.totalfreedommod.blocking.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.staff.StaffMember;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public enum CommandBlockerRank
|
||||
{
|
||||
|
||||
ANYONE("a"),
|
||||
EVERYONE("e"),
|
||||
OP("o"),
|
||||
SUPER("s"),
|
||||
TELNET("t"),
|
||||
SENIOR("c"),
|
||||
ADMIN("a"),
|
||||
SENIOR_ADMIN("s"),
|
||||
NOBODY("n");
|
||||
//
|
||||
private final String token;
|
||||
|
||||
private CommandBlockerRank(String token)
|
||||
CommandBlockerRank(String token)
|
||||
{
|
||||
this.token = token;
|
||||
}
|
||||
@ -35,19 +32,14 @@ public enum CommandBlockerRank
|
||||
|
||||
public static CommandBlockerRank fromSender(CommandSender sender)
|
||||
{
|
||||
if (!(sender instanceof Player))
|
||||
Admin admin = TotalFreedomMod.plugin().al.getAdmin(sender);
|
||||
if (admin != null)
|
||||
{
|
||||
return TELNET;
|
||||
}
|
||||
|
||||
StaffMember staffMember = TotalFreedomMod.plugin().sl.getAdmin(sender);
|
||||
if (staffMember != null)
|
||||
{
|
||||
if (staffMember.getRank() == Rank.SENIOR_ADMIN)
|
||||
if (admin.getRank() == Rank.SENIOR_ADMIN)
|
||||
{
|
||||
return SENIOR;
|
||||
return SENIOR_ADMIN;
|
||||
}
|
||||
return SUPER;
|
||||
return ADMIN;
|
||||
}
|
||||
|
||||
if (sender.isOp())
|
||||
@ -55,8 +47,7 @@ public enum CommandBlockerRank
|
||||
return OP;
|
||||
}
|
||||
|
||||
return ANYONE;
|
||||
|
||||
return EVERYONE;
|
||||
}
|
||||
|
||||
public static CommandBlockerRank fromToken(String token)
|
||||
@ -68,6 +59,6 @@ public enum CommandBlockerRank
|
||||
return rank;
|
||||
}
|
||||
}
|
||||
return ANYONE;
|
||||
return EVERYONE;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user