Commit Graph

12 Commits

Author SHA1 Message Date
Dico200
1750c82208 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
2015-03-19 23:51:33 +01:00
jomo
4357c46085 copy dict keys before iterating
python doesn't like changing dicts while iterating over that dict
2015-03-15 05:00:04 +01:00
jomo
1db0ac4cd5 Revert "remove redundant loop"
This reverts commit cc50dc30bc.
2015-03-15 04:40:09 +01:00
jomo
1e7bd51b3b debug pmutils player leave event 2015-03-15 04:36:08 +01:00
jomo
cc50dc30bc remove redundant loop 2015-03-15 04:28:56 +01:00
jomo
a87ad7b2e9 fix all bukkit/uuid issues in pmtoggle 2015-03-15 04:26:53 +01:00
Dico200
1b2b3c2fa9 Fixed UUID problem in Pmtoggle
Thanks @jomo  for pointing out
2015-03-15 02:41:58 +01:00
Dico200
c0c1879fde Add colon in pmtoggle 2015-03-15 02:30:52 +01:00
Dico200
017d53928a Add check if chatevent is cancelled in pmtoggle 2015-03-15 02:30:33 +01:00
Dico200
5a669893b4 Remove redundant try/except in Pmtoggle module 2015-03-15 02:18:02 +01:00
Dico200
9a3942c034 pmtoggle works now, Fixes comments by Jomo
BTW: I didn't use retrieve_player as it gets an Offline player which
makes it slower and I know the player is online. That's why I used
Bukkit.getPlayer(juuid(uuidstring)). (line 40)
2015-03-15 02:16:30 +01:00
Dico200
43a8ec9481 Added pmtoggle module
pmtoggle adds /tm [player](togglemessage).
When activated, any chat message you send will be sent as:
/msg [player] [msg]
2015-03-15 01:13:36 +01:00