From c1e7fdbb1dee40357acc0fad768ce55152f4ddff Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 30 Mar 2021 16:27:20 +0200 Subject: [PATCH] Add SWCommand.ClassMapper.local --- SpigotCore_Main/src/de/steamwar/command/SWCommand.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SpigotCore_Main/src/de/steamwar/command/SWCommand.java b/SpigotCore_Main/src/de/steamwar/command/SWCommand.java index 7260a41..0c2f743 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SWCommand.java +++ b/SpigotCore_Main/src/de/steamwar/command/SWCommand.java @@ -88,7 +88,11 @@ public abstract class SWCommand { } }); addMapper(ClassMapper.class, method, i -> i == 0, false, TypeMapper.class, (anno, typeMapper) -> { - SWCommandUtils.addMapper(anno.value().getTypeName(), typeMapper); + if (anno.local()) { + localTypeMapper.put(anno.value().getTypeName(), typeMapper); + } else { + SWCommandUtils.addMapper(anno.value().getTypeName(), typeMapper); + } }); add(Register.class, method, i -> i > 0, true, null, (anno, parameters) -> { if (!anno.help()) { @@ -215,5 +219,7 @@ public abstract class SWCommand { @Target({ElementType.METHOD}) protected @interface ClassMapper { Class value(); + + boolean local() default false; } }