Paper/nms-patches/CommandBlockListenerAbstract.patch
2019-12-11 09:00:00 +11:00

38 lines
1.8 KiB
Diff

--- a/net/minecraft/server/CommandBlockListenerAbstract.java
+++ b/net/minecraft/server/CommandBlockListenerAbstract.java
@@ -4,6 +4,7 @@
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.annotation.Nullable;
+import org.bukkit.command.CommandSender;
public abstract class CommandBlockListenerAbstract implements ICommandListener {
@@ -16,6 +17,10 @@
private IChatBaseComponent lastOutput;
private String command = "";
private IChatBaseComponent customName;
+ // CraftBukkit start
+ @Override
+ public abstract CommandSender getBukkitSender(CommandListenerWrapper wrapper);
+ // CraftBukkit end
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;
- }
-
- });
-
- minecraftserver.getCommandDispatcher().a(commandlistenerwrapper, this.command);
+ this.successCount = minecraftserver.getCommandDispatcher().dispatchServerCommand(this.getWrapper(), this.command); // CraftBukkit
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Executing command block");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Command to be executed");