From 7e17d5ab3452089f5fd3ce6bf680e94b7293f8ab Mon Sep 17 00:00:00 2001 From: Chaos Date: Thu, 3 Feb 2022 23:01:37 +0100 Subject: [PATCH] Hotfix SchemSearch and Public Schems --- .../de/steamwar/schematicsystem/commands/SchematicCommand.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java index bf885f4..f170b37 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java @@ -332,6 +332,7 @@ public class SchematicCommand extends SWCommand { return true; }); player.sendMessage("§eSchematics §8(§e" + nodes.size() + "§8)"); + int finalUserId = userId; nodes.forEach(node -> { String br = node.generateBreadcrumbs(user); String displayName = br; @@ -343,7 +344,7 @@ public class SchematicCommand extends SWCommand { } TextComponent schematics = new TextComponent("§7" + displayName); schematics.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§eSchematic verwalten").create())); - schematics.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/schem info " + br)); + schematics.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/schem info " + (finalUserId == 0 ? "public ":"") + br)); player.spigot().sendMessage(schematics); });