From f6e9ac9ebd3a15451943f3dabf56eb644c3ba69a Mon Sep 17 00:00:00 2001 From: Lixfel Date: Wed, 25 Sep 2019 18:43:52 +0200 Subject: [PATCH] Typ clickable --- .../schematicsystem/commands/SchematicCommand.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/schematicsystem/commands/SchematicCommand.java b/src/de/steamwar/schematicsystem/commands/SchematicCommand.java index fdd3d39..9feb5cb 100644 --- a/src/de/steamwar/schematicsystem/commands/SchematicCommand.java +++ b/src/de/steamwar/schematicsystem/commands/SchematicCommand.java @@ -311,7 +311,13 @@ public class SchematicCommand implements CommandExecutor { return; player.sendMessage("§eName: §7" + schematic.getSchemName()); - player.sendMessage("§eTyp: §7" + schematic.getSchemType().name()); + + TextComponent type = new TextComponent("§eTyp: §7" + schematic.getSchemType().name()); + if(WarkingUser.get(schematic.getSchemOwner()).getUUID().equals(player.getUniqueId())){ + type.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText("§eTyp ändern"))); + type.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/schem changetype " + schematic.getSchemName())); + } + player.spigot().sendMessage(type); List checkedSchematics = CheckedSchematic.getLastDeclined(player.getUniqueId()); for(int i = checkedSchematics.size() -1; i >= 0; i--) {