From 5a2c06232df4371a41fb5d5dcf859a46bfb13daf Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 30 Mar 2021 09:21:28 +0200 Subject: [PATCH] Remove SWCommandUtils StringBuilder support as Mapper --- SpigotCore_Main/src/de/steamwar/command/SWCommand.java | 2 ++ SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/SpigotCore_Main/src/de/steamwar/command/SWCommand.java b/SpigotCore_Main/src/de/steamwar/command/SWCommand.java index 30da3ec..47b6971 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SWCommand.java +++ b/SpigotCore_Main/src/de/steamwar/command/SWCommand.java @@ -180,6 +180,7 @@ public abstract class SWCommand { @Target({ElementType.METHOD}) protected @interface Register { String[] value() default {}; + boolean help() default false; } @@ -187,6 +188,7 @@ public abstract class SWCommand { @Target({ElementType.PARAMETER, ElementType.METHOD}) protected @interface Mapper { String value(); + boolean local() default false; } diff --git a/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java b/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java index b97db6d..8cd20fe 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java +++ b/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java @@ -60,7 +60,6 @@ public class SWCommandUtils { addMapper(double.class, Double.class, createMapper(Double::parseDouble, numberCompleter(Double::parseDouble))); addMapper(int.class, Integer.class, createMapper(Integer::parseInt, numberCompleter(Integer::parseInt))); MAPPER_FUNCTIONS.put(String.class.getTypeName(), createMapper(s -> s, Collections::singletonList)); - MAPPER_FUNCTIONS.put(StringBuilder.class.getTypeName(), createMapper(StringBuilder::new, Collections::singletonList)); MAPPER_FUNCTIONS.put(Player.class.getTypeName(), createMapper(Bukkit::getPlayer, s -> Bukkit.getOnlinePlayers().stream().map(Player::getName).collect(Collectors.toList()))); MAPPER_FUNCTIONS.put(GameMode.class.getTypeName(), createMapper(s -> { s = s.toLowerCase();