From ace8419e314a8776557b552fab6cd986bb11e1eb Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 10 Sep 2022 21:48:48 +0200 Subject: [PATCH] Hotfix: Remove Delete button on Public Schems --- .../commands/SchematicCommandUtils.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommandUtils.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommandUtils.java index 24412f0..a0a8ff1 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommandUtils.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommandUtils.java @@ -269,11 +269,13 @@ public class SchematicCommandUtils { } } - TextComponent delete = SchematicSystem.MESSAGE.parseToComponent("UTIL_INFO_ACTION_DELETE", false, player); - delete.setColor(ChatColor.DARK_RED); - delete.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent[]{SchematicSystem.MESSAGE.parseToComponent("UTIL_INFO_ACTION_DELETE_HOVER", false, player)})); - delete.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/schem delete " + node.generateBreadcrumbs(user))); - base.addExtra(delete); + if (node.getOwner() != 0) { + TextComponent delete = SchematicSystem.MESSAGE.parseToComponent("UTIL_INFO_ACTION_DELETE", false, player); + delete.setColor(ChatColor.DARK_RED); + delete.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent[]{SchematicSystem.MESSAGE.parseToComponent("UTIL_INFO_ACTION_DELETE_HOVER", false, player)})); + delete.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/schem delete " + node.generateBreadcrumbs(user))); + base.addExtra(delete); + } if (!base.getExtra().isEmpty()) { player.spigot().sendMessage(base);