From 1750c8220885348f63e4e07d086a5235ac50dc8d Mon Sep 17 00:00:00 2001 From: Dico200 Date: Thu, 19 Mar 2015 23:51:33 +0100 Subject: Changed all CommandExecutor arguments Added arguments command and label to all command executor functions, hopefully for massive performance increase. This is due to the following mess in PythonLoader: ``` Java @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { boolean result; if (argcount == -1) { try { result = call(4, sender, command, label, args); argcount = 4; } catch (PyException e) { //this could goof up someone ... they'll probably yell at us and eventually read this code ... fuck them if (e.type == Py.TypeError && (e.value.toString().endsWith("takes exactly 3 arguments (4 given)") || e.value.toString().endsWith("takes exactly 4 arguments (5 given)"))) { result = call(3, sender, command, label, args); argcount = 3; } else if (e.type == Py.TypeError && (e.value.toString().endsWith("takes exactly 2 arguments (4 given)") || e.value.toString().endsWith("takes exactly 3 arguments (5 given)"))) { result = call(2, sender, command, label, args); argcount = 2; } else { throw e; } } } else { result = call(argcount, sender, command, label, args); } return result; } ``` Note: Still WIP on reports - I'm working on making it keep solved reports to fix issue 10 --- lagchunks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lagchunks.py') diff --git a/lagchunks.py b/lagchunks.py index 3b41add..162d224 100644 --- a/lagchunks.py +++ b/lagchunks.py @@ -37,7 +37,7 @@ def tp_chunk(sender, id): @hook.command("lagchunks") -def on_lagchunks_command(sender, args): +def on_lagchunks_command(sender, command, label, args): if sender.hasPermission("utils.lagchunks"): plugin_header(sender, "Lagchunks") global lagchunks -- cgit v1.2.3