From a45c2b468df430d6020b196c4fb825cec0a06c78 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 21 May 2022 15:21:25 +0200 Subject: [PATCH] Fix names Signed-off-by: Lixfel --- .../src/de/steamwar/fightsystem/fight/HotbarKit.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/fight/HotbarKit.java b/FightSystem_Core/src/de/steamwar/fightsystem/fight/HotbarKit.java index ff0162d..09fa533 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/fight/HotbarKit.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/fight/HotbarKit.java @@ -30,6 +30,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.potion.PotionEffect; import java.util.Collection; @@ -67,8 +68,11 @@ public class HotbarKit extends Kit implements Listener { @Override public synchronized void loadToPlayer(Player player) { for(int i = 0; i < HOTBAR_SIZE; i++) { - if(nameTags[i] != null) - Objects.requireNonNull(getInventory()[i].getItemMeta()).setDisplayName(FightSystem.getMessage().parse(nameTags[i], player, Config.GameName)); + if(nameTags[i] != null) { + ItemMeta meta = Objects.requireNonNull(getInventory()[i].getItemMeta()); + meta.setDisplayName(FightSystem.getMessage().parse(nameTags[i], player, Config.GameName)); + getInventory()[i].setItemMeta(meta); + } } super.loadToPlayer(player); }