mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-30 02:05:41 +00:00
Format change (/cmdspy)
While executing this during administration I noticed the ratio between execution and response was rather delayed, and I realized it's because the command is waiting for all the tables and grab methods to run before sending the player the enabled/disabled message. This creates a false sense of lag and is as simple as making the message run before anything else, given that the methods run and tables save almost instantly, this won't negatively affect the module or command.
This commit is contained in:
parent
ee04a456a1
commit
05f94920d9
@ -14,12 +14,11 @@ public class Command_cmdspy extends FreedomCommand
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
|
||||
msg("CommandSpy " + (admin.getCommandSpy() ? "enabled." : "disabled."));
|
||||
Admin admin = plugin.al.getAdmin(playerSender);
|
||||
admin.setCommandSpy(!admin.getCommandSpy());
|
||||
plugin.al.save(admin);
|
||||
plugin.al.updateTables();
|
||||
msg("CommandSpy " + (admin.getCommandSpy() ? "enabled." : "disabled."));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user