From 173361e1be44f560c27cf3544c159c167023a2ea Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 30 Mar 2021 10:01:28 +0200 Subject: [PATCH] Add SWCommand.register --- SpigotCore_Main/src/de/steamwar/command/SWCommand.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SpigotCore_Main/src/de/steamwar/command/SWCommand.java b/SpigotCore_Main/src/de/steamwar/command/SWCommand.java index 47b6971..51353a9 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SWCommand.java +++ b/SpigotCore_Main/src/de/steamwar/command/SWCommand.java @@ -77,7 +77,7 @@ public abstract class SWCommand { return strings; } }; - SWCommandUtils.commandMap.register("steamwar", this.command); + register(); for (Method method : getClass().getDeclaredMethods()) { addMapper(Mapper.class, method, i -> i == 0, false, TypeMapper.class, (anno, typeMapper) -> { @@ -176,6 +176,10 @@ public abstract class SWCommand { command.unregister(SWCommandUtils.commandMap); } + protected void register() { + SWCommandUtils.commandMap.register("steamwar", this.command); + } + @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) protected @interface Register {