mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-23 08:46:44 +01:00
Lowered the priority of the old command handler event. A number of plugins were using this event incorrectly. A new event, the command preprocesser event, has replaced the previous function of the original command event.
This commit is contained in:
parent
acd0344452
commit
d4b67c5549
1 changed files with 9 additions and 1 deletions
|
@ -622,7 +622,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
CraftPlayer player = getPlayer();
|
CraftPlayer player = getPlayer();
|
||||||
|
|
||||||
PlayerChatEvent event = new PlayerChatEvent(Type.PLAYER_COMMAND, player, s);
|
PlayerChatEvent event = new PlayerChatEvent(Type.PLAYER_COMMAND_PREPROCESS, player, s);
|
||||||
server.getPluginManager().callEvent(event);
|
server.getPluginManager().callEvent(event);
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
|
@ -641,6 +641,14 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||||
if (targetPluginFound) {
|
if (targetPluginFound) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Legacy command handler
|
||||||
|
event = new PlayerChatEvent(Type.PLAYER_COMMAND, player, s);
|
||||||
|
server.getPluginManager().callEvent(event);
|
||||||
|
if (event.isCancelled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
s = event.getMessage();
|
s = event.getMessage();
|
||||||
player = (CraftPlayer) event.getPlayer();
|
player = (CraftPlayer) event.getPlayer();
|
||||||
EntityPlayer e = player.getHandle();
|
EntityPlayer e = player.getHandle();
|
||||||
|
|
Loading…
Add table
Reference in a new issue