SteamWar/FightSystem
Archiviert
13
1

Fix names
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2022-05-21 15:21:25 +02:00
Ursprung d12806f51b
Commit a45c2b468d

Datei anzeigen

@ -30,6 +30,7 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffect;
import java.util.Collection; import java.util.Collection;
@ -67,8 +68,11 @@ public class HotbarKit extends Kit implements Listener {
@Override @Override
public synchronized void loadToPlayer(Player player) { public synchronized void loadToPlayer(Player player) {
for(int i = 0; i < HOTBAR_SIZE; i++) { for(int i = 0; i < HOTBAR_SIZE; i++) {
if(nameTags[i] != null) if(nameTags[i] != null) {
Objects.requireNonNull(getInventory()[i].getItemMeta()).setDisplayName(FightSystem.getMessage().parse(nameTags[i], player, Config.GameName)); ItemMeta meta = Objects.requireNonNull(getInventory()[i].getItemMeta());
meta.setDisplayName(FightSystem.getMessage().parse(nameTags[i], player, Config.GameName));
getInventory()[i].setItemMeta(meta);
}
} }
super.loadToPlayer(player); super.loadToPlayer(player);
} }