From 9bfa4282b5a126f55ca608d075496110f8940671 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 14 Jun 2022 17:42:49 +0200 Subject: [PATCH] Fix BauInfoBauGuiItem Signed-off-by: yoyosource --- .../bausystem/features/bau/BauInfoBauGuiItem.java | 8 +++++++- .../de/steamwar/bausystem/features/util/SkullCommand.java | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauInfoBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauInfoBauGuiItem.java index 89c48648..a9d63e31 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauInfoBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauInfoBauGuiItem.java @@ -29,6 +29,7 @@ import de.steamwar.bausystem.region.Region; import de.steamwar.bausystem.region.flags.Flag; import de.steamwar.inventory.SWItem; import de.steamwar.sql.SteamwarUser; +import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; @@ -45,7 +46,12 @@ public class BauInfoBauGuiItem extends BauGuiItem { @Override public ItemStack getItem(Player player) { - SWItem itemStack = SWItem.getPlayerSkull(SteamwarUser.get(BauServer.getInstance().getOwner()).getUserName()); + SWItem itemStack; + if (!player.getName().endsWith("⍇")) { + itemStack = SWItem.getPlayerSkull(SteamwarUser.get(BauServer.getInstance().getOwner()).getUserName()); + } else { + itemStack = new SWItem(Material.PLAYER_HEAD, ""); + } itemStack.setName(BauSystem.MESSAGE.parse("BAU_INFO_ITEM_NAME", player)); Region region = Region.getRegion(player.getLocation()); List stringList = new ArrayList<>(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/SkullCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/SkullCommand.java index 6e74805b..a1205cf2 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/SkullCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/SkullCommand.java @@ -44,6 +44,7 @@ public class SkullCommand extends SWCommand { @Register(description = "SKULL_HELP") public void giveCommand(Player p, @Mapper("player") String skull) { + // TODO: Add message to invalid Skulls! ItemStack is = SWItem.getPlayerSkull(skull).getItemStack(); SkullMeta sm = (SkullMeta) is.getItemMeta(); assert sm != null;