Cleanup/command dispatching (#12713)
This commit is contained in:
@ -12,12 +12,18 @@
|
||||
|
||||
public int getSuccessCount() {
|
||||
return this.successCount;
|
||||
@@ -108,7 +_,7 @@
|
||||
@@ -108,7 +_,13 @@
|
||||
this.successCount++;
|
||||
}
|
||||
});
|
||||
- server.getCommands().performPrefixedCommand(commandSourceStack, this.command);
|
||||
+ server.getCommands().dispatchServerCommand(commandSourceStack, this.command); // CraftBukkit
|
||||
+ // Paper start - ServerCommandEvent
|
||||
+ org.bukkit.event.server.ServerCommandEvent event = new org.bukkit.event.server.ServerCommandEvent(commandSourceStack.getBukkitSender(), net.minecraft.commands.Commands.trimOptionalPrefix(this.command));
|
||||
+ if (!event.callEvent()) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ server.getCommands().performPrefixedCommand(commandSourceStack, event.getCommand());
|
||||
+ // Paper end - ServerCommandEvent
|
||||
} catch (Throwable var6) {
|
||||
CrashReport crashReport = CrashReport.forThrowable(var6, "Executing command block");
|
||||
CrashReportCategory crashReportCategory = crashReport.addCategory("Command to be executed");
|
||||
|
||||
Reference in New Issue
Block a user