diff --git a/Essentials/src/main/java/com/earth2me/essentials/commands/EssentialsCommandNode.java b/Essentials/src/main/java/com/earth2me/essentials/commands/EssentialsCommandNode.java index cd7c0a690..25fb0779e 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/commands/EssentialsCommandNode.java +++ b/Essentials/src/main/java/com/earth2me/essentials/commands/EssentialsCommandNode.java @@ -82,7 +82,11 @@ public abstract class EssentialsCommandNode { } public void execute(final RunHandler runHandler) { - this.execute(runHandler, ctx -> new ArrayList<>()); + this.execute(runHandler, ctx -> Collections.emptyList()); + } + + public void execute(final LegacyRunHandler runHandler) { + this.execute(runHandler, ctx -> Collections.emptyList()); } public void execute(final RunHandler runHandler, final List tabValues) { @@ -225,6 +229,17 @@ public abstract class EssentialsCommandNode { void handle(WalkContext ctx) throws Exception; } + // todo: not sure whether to keep or to rewrite usages + @Deprecated + public interface LegacyRunHandler extends RunHandler { + @Override + default void handle(WalkContext ctx) throws Exception { + handle(ctx.server, ctx.sender, ctx.label, ctx.args); + } + + void handle(Server server, T sender, String label, String[] args) throws Exception; + } + public interface TabHandler { List handle(WalkContext ctx) throws Exception; }