From 9436616440cca0fdaa768caf65b29030fbf5f9f8 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 29 Mar 2021 22:57:00 +0200 Subject: [PATCH] Fix design stuff --- .../src/de/steamwar/command/SWCommand.java | 1 - .../src/de/steamwar/command/SWCommandUtils.java | 13 +------------ .../src/de/steamwar/command/SubCommand.java | 1 - 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/SpigotCore_Main/src/de/steamwar/command/SWCommand.java b/SpigotCore_Main/src/de/steamwar/command/SWCommand.java index 0fff614..8b4f663 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SWCommand.java +++ b/SpigotCore_Main/src/de/steamwar/command/SWCommand.java @@ -189,5 +189,4 @@ public abstract class SWCommand { protected @interface LocalMapper { String value(); } - } diff --git a/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java b/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java index dac72ea..981b5ca 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java +++ b/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java @@ -127,17 +127,7 @@ public class SWCommandUtils { } public static TypeMapper createMapper(Function mapper, Function> tabCompleter) { - return new TypeMapper() { - @Override - public T map(String s) { - return mapper.apply(s); - } - - @Override - public List tabCompletes(CommandSender commandSender, String s) { - return tabCompleter.apply(s); - } - }; + return createMapper(mapper, (commandSender, s) -> tabCompleter.apply(s)); } public static TypeMapper createMapper(Function mapper, BiFunction> tabCompleter) { @@ -169,5 +159,4 @@ public class SWCommandUtils { if (method.getAnnotations().length != 1) return null; return method.getAnnotation(annotation); } - } diff --git a/SpigotCore_Main/src/de/steamwar/command/SubCommand.java b/SpigotCore_Main/src/de/steamwar/command/SubCommand.java index b1bb15c..e0088ec 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SubCommand.java +++ b/SpigotCore_Main/src/de/steamwar/command/SubCommand.java @@ -134,5 +134,4 @@ class SubCommand { } return Collections.emptyList(); } - }