From d385fb6d257ee3b5798b0268fa8f22c4c12c637c Mon Sep 17 00:00:00 2001 From: yoyosource Date: Wed, 8 Dec 2021 17:36:46 +0100 Subject: [PATCH] Update TraceCommand Signed-off-by: yoyosource --- .../features/tracer/TraceCommand.java | 60 ++++--------------- 1 file changed, 12 insertions(+), 48 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java index 74a957db..92dc5e91 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java @@ -114,8 +114,8 @@ public class TraceCommand extends SWCommand { listCommand(p, 0); } - @Register({"record", "list"}) - @Register({"list"}) + @Register(value = {"record", "list"}, noTabComplete = true) + @Register(value = {"list"}, noTabComplete = true) public void listCommand(Player player, int page) { if (!permissionCheck(player)) return; ListChatView.chatView(player, StoredRecords.getRecords(), page, record -> { @@ -139,19 +139,19 @@ public class TraceCommand extends SWCommand { }); } - @Register({"record", "delete"}) + @Register(value = {"record", "delete"}, noTabComplete = true) public void recordDelete(Player p, int id) { if (!permissionCheck(p)) return; StoredRecords.remove(id); BauSystem.MESSAGE.send("TRACE_RECORD_DELETE", p); } - @Register("record") + @Register(value = "record", noTabComplete = true) public void recordList(Player p, int record) { recordList(p, record, 0); } - @Register("record") + @Register(value = "record", noTabComplete = true) public void recordList(Player player, int recordID, int page) { if (!permissionCheck(player)) return; Record traceRecord = StoredRecords.get(recordID); @@ -180,7 +180,7 @@ public class TraceCommand extends SWCommand { }); } - @Register({"record", "tnt", "delete"}) + @Register(value = {"record", "tnt", "delete"}, noTabComplete = true) public void deleteRecordTNT(Player player, int recordID, int tntID) { if (!permissionCheck(player)) return; Record record = StoredRecords.get(recordID); @@ -192,13 +192,13 @@ public class TraceCommand extends SWCommand { BauSystem.MESSAGE.send("TRACE_TNT_DELETE", player); } - @Register("record") - public void recordTNTPositions(Player player, int recordID, @Mapper("tnt") String tnt, int tntID) { + @Register(value = "record", noTabComplete = true) + public void recordTNTPositions(Player player, int recordID, @StaticValue("tnt") String tnt, int tntID) { recordTNTPositions(player, recordID, tnt, tntID, 0); } - @Register("record") - public void recordTNTPositions(Player player, int recordID, @Mapper("tnt") String tnt, int tntID, int page) { + @Register(value = "record", noTabComplete = true) + public void recordTNTPositions(Player player, int recordID, @StaticValue("tnt") String tnt, int tntID, int page) { if (!permissionCheck(player)) return; Record record = StoredRecords.get(recordID); if (record == null) { @@ -225,8 +225,8 @@ public class TraceCommand extends SWCommand { }); } - @Register("record") - public void recordTNTPositions(Player player, int recordID, @Mapper("tnt") String tnt, int tntID, @Mapper("fuse") String fuse, int fuseTicks) { + @Register(value = "record", noTabComplete = true) + public void recordTNTPositions(Player player, int recordID, @StaticValue("tnt") String tnt, int tntID, @StaticValue("fuse") String fuse, int fuseTicks) { if (!permissionCheck(player)) return; Record record = StoredRecords.get(recordID); if (record == null) { @@ -361,40 +361,4 @@ public class TraceCommand extends SWCommand { } return true; } - - @Mapper(value = "tnt", local = true) - public TypeMapper tntTypeMapper() { - return new TypeMapper() { - @Override - public String map(CommandSender commandSender, String[] previousArguments, String s) { - if (s.equals("tnt")) { - return "tnt"; - } - return null; - } - - @Override - public List tabCompletes(CommandSender commandSender, String[] strings, String s) { - return Collections.singletonList("tnt"); - } - }; - } - - @Mapper(value = "fuse", local = true) - public TypeMapper fuseTypeMapper() { - return new TypeMapper() { - @Override - public String map(CommandSender commandSender, String[] previousArguments, String s) { - if (s.equals("fuse")) { - return "fuse"; - } - return null; - } - - @Override - public List tabCompletes(CommandSender commandSender, String[] strings, String s) { - return Collections.singletonList("fuse"); - } - }; - } }