From 94711318f9a1c4e9d16a70f4457c4f0ce50e96b8 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 28 Dec 2021 12:28:49 +0100 Subject: [PATCH] Update SchematicCommand to CommandFramework --- .../commands/SchematicCommand.java | 35 +++---------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java index 52e6df2..64995df 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java @@ -66,35 +66,18 @@ public class SchematicCommand extends SWCommand { @Register("list") @Register({"list", "/"}) - public void schemList(Player player) { - renderSchemlist(player, SchematicNode.getSchematicsAccessibleByUser(getUser(player).getId(), 0), 0, "", false, null); - } - - @Register("list") - @Register({"list", "/"}) - public void schemList(Player player, int page) { + public void schemList(Player player, @OptionalValue("0") int page) { renderSchemlist(player, SchematicNode.getSchematicsAccessibleByUser(getUser(player).getId(), 0), page, "", false, null); } @Register({"list", "public"}) - public void schemListPublic(Player player, @Mapper("publicDirMapper") SchematicNode node) { - schemList(player, node); - } - - @Register({"list", "public"}) - public void schemListPublic(Player player, @Mapper("publicDirMapper") SchematicNode node, int page) { + public void schemListPublic(Player player, @Mapper("publicDirMapper") SchematicNode node, @OptionalValue("0") int page) { schemList(player, node, page); } @Register({"list", "public"}) @Register({"list", "public", "/"}) - public void schemListPublic(Player player) { - renderSchemlist(player, SchematicNode.getSchematicsAccessibleByUser(0, 0), 0, "", true, null); - } - - @Register({"list", "public"}) - @Register({"list", "public", "/"}) - public void schemListPublic(Player player, int page) { + public void schemListPublic(Player player, @OptionalValue("0") int page) { renderSchemlist(player, SchematicNode.getSchematicsAccessibleByUser(0, 0), page, "", true, null); } @@ -105,17 +88,7 @@ public class SchematicCommand extends SWCommand { } @Register("list") - public void schemList(Player player, @Mapper("dirMapper") SchematicNode node) { - SteamwarUser user = getUser(player); - if (!node.isDir()) { - player.sendMessage(SchematicSystem.PREFIX + "Das ist eine Schematic und kein Ordner"); - } else { - renderSchemlist(player, SchematicNode.getSchematicNodeInNode(node), 0, node.generateBreadcrumbs(user), node.getOwner() == 0, node); - } - } - - @Register("list") - public void schemList(Player player, @Mapper("dirMapper") SchematicNode node, int page) { + public void schemList(Player player, @Mapper("dirMapper") SchematicNode node, @OptionalValue("0") int page) { SteamwarUser user = getUser(player); if (!node.isDir()) { player.sendMessage(SchematicSystem.PREFIX + "Das ist eine Schematic und kein Ordner");