SPIGOT-5502: Fix command block successcount being set to return value rather than actual count

Dieser Commit ist enthalten in:
md_5 2020-01-06 13:44:16 +11:00
Ursprung 2fd7964587
Commit b98e2defcb

Datei anzeigen

@ -19,19 +19,12 @@
public CommandBlockListenerAbstract() {
this.customName = CommandBlockListenerAbstract.c;
@@ -105,14 +110,7 @@
if (minecraftserver != null && minecraftserver.J() && minecraftserver.getEnableCommandBlock() && !UtilColor.b(this.command)) {
try {
this.lastOutput = null;
- CommandListenerWrapper commandlistenerwrapper = this.getWrapper().a((commandcontext, flag, i) -> {
- if (flag) {
- ++this.successCount;
- }
-
- });
-
@@ -112,7 +117,7 @@
});
- minecraftserver.getCommandDispatcher().a(commandlistenerwrapper, this.command);
+ this.successCount = minecraftserver.getCommandDispatcher().dispatchServerCommand(this.getWrapper(), this.command); // CraftBukkit
+ minecraftserver.getCommandDispatcher().dispatchServerCommand(commandlistenerwrapper, this.command); // CraftBukkit
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Executing command block");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Command to be executed");