mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-12-28 12:47:36 +00:00
Remove getCommandMap() method in CommandBlocker
This commit is contained in:
parent
b4dd35c4df
commit
794a25ba16
@ -30,24 +30,6 @@ public class CommandBlocker extends FreedomService
|
||||
private final Map<String, CommandBlockerEntry> entryList = Maps.newHashMap();
|
||||
private final List<String> unknownCommands = Lists.newArrayList();
|
||||
|
||||
public static CommandMap getCommandMap()
|
||||
{
|
||||
try
|
||||
{
|
||||
SimplePluginManager simplePluginManager = (SimplePluginManager)Bukkit.getServer().getPluginManager();
|
||||
|
||||
Field commandMapField = SimplePluginManager.class.getDeclaredField("commandMap");
|
||||
commandMapField.setAccessible(true);
|
||||
|
||||
return (SimpleCommandMap)commandMapField.get(simplePluginManager);
|
||||
}
|
||||
catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e)
|
||||
{
|
||||
FLog.severe("Failed to get command map field (" + e.getMessage() + ")");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart()
|
||||
{
|
||||
@ -65,7 +47,7 @@ public class CommandBlocker extends FreedomService
|
||||
entryList.clear();
|
||||
unknownCommands.clear();
|
||||
|
||||
final CommandMap commandMap = getCommandMap();
|
||||
final CommandMap commandMap = Bukkit.getCommandMap();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<String> blockedCommands = (List<String>)ConfigEntry.BLOCKED_COMMANDS.getList();
|
||||
|
Loading…
Reference in New Issue
Block a user