From 84dc52d62db3194663a9fae929f07368ae778f03 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 29 Sep 2019 16:58:21 +0200 Subject: [PATCH] Schem list public fix --- src/de/steamwar/schematicsystem/commands/GUI.java | 6 +++++- .../schematicsystem/commands/SchematicCommand.java | 9 +-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/de/steamwar/schematicsystem/commands/GUI.java b/src/de/steamwar/schematicsystem/commands/GUI.java index 468249e..b6db76b 100644 --- a/src/de/steamwar/schematicsystem/commands/GUI.java +++ b/src/de/steamwar/schematicsystem/commands/GUI.java @@ -164,8 +164,12 @@ class GUI { } static void list(Player p){ + list(p, WarkingUser.get(p.getUniqueId()).getId()); + } + + static void list(Player p, int pid){ List> schemList = new LinkedList<>(); - List schems = Schematic.getSchemsAccessibleByUser(p.getUniqueId()); + List schems = Schematic.getSchemsAccessibleByUser(pid); for(Schematic schem : schems) { Material m; diff --git a/src/de/steamwar/schematicsystem/commands/SchematicCommand.java b/src/de/steamwar/schematicsystem/commands/SchematicCommand.java index 9feb5cb..ca30f61 100644 --- a/src/de/steamwar/schematicsystem/commands/SchematicCommand.java +++ b/src/de/steamwar/schematicsystem/commands/SchematicCommand.java @@ -108,14 +108,7 @@ public class SchematicCommand implements CommandExecutor { } if("public".equalsIgnoreCase(args[1])){ - if(args.length == 3){ - try { - sendPlayerSchematicList(Integer.parseInt(args[2]), 0, player); - } catch (NumberFormatException ex) { - player.sendMessage(SchematicSystem.PREFIX + "§cUngültige Seitenzahl"); - } - }else - sendPlayerSchematicList(0, 0, player); + GUI.list(player, 0); return; }