diff --git a/src/main/java/de/fanta/challenges/challenges/AllItemsChallenge.java b/src/main/java/de/fanta/challenges/challenges/AllItemsChallenge.java index af68fee..b9ea7a4 100644 --- a/src/main/java/de/fanta/challenges/challenges/AllItemsChallenge.java +++ b/src/main/java/de/fanta/challenges/challenges/AllItemsChallenge.java @@ -79,7 +79,7 @@ } } - bossBar.name(Component.text("Item » ", ChatUtil.GREEN).append(Component.translatable(item.translationKey(), ChatUtil.BLUE).append(Component.text(" (", ChatUtil.BLUE).append(Component.text(foundItems.size() + "/" + itemcount, ChatUtil.GREEN).append(Component.text(")", ChatUtil.BLUE)))))); + bossBar.name(Component.text("Item » ", ChatUtil.GREEN).append(ChatUtil.getTrasnlateItemComponent(item).color(ChatUtil.BLUE).append(Component.text(" (", ChatUtil.BLUE).append(Component.text(foundItems.size() + "/" + itemcount, ChatUtil.GREEN).append(Component.text(")", ChatUtil.BLUE)))))); float progress = foundItems.size() * 100.0f / itemcount / 100.0f; bossBar.progress(progress); } else { @@ -107,11 +107,11 @@ item = itemsToSearch.get(r.nextInt((itemsToSearch.size() - 1) + 1)); Config.setValue("allitemscurrentitem", new ItemStack(item)); if (skipped) { - ChatUtil.sendBrodCastMessage(Component.text("Item: ", ChatUtil.GREEN).append(Component.translatable(old.translationKey(), ChatUtil.BLUE).append(Component.text(" wurde von " + p.getName() + " übersprungen.", ChatUtil.GREEN)))); + ChatUtil.sendBrodCastMessage(Component.text("Item: ", ChatUtil.GREEN).append(ChatUtil.getTrasnlateItemComponent(old).color(ChatUtil.BLUE).append(Component.text(" wurde von " + p.getName() + " übersprungen.", ChatUtil.GREEN)))); } else { - ChatUtil.sendBrodCastMessage(Component.text("Item: ", ChatUtil.GREEN).append(Component.translatable(old.translationKey(), ChatUtil.BLUE).append(Component.text(" wurde von " + p.getName() + " Registriert.", ChatUtil.GREEN)))); + ChatUtil.sendBrodCastMessage(Component.text("Item: ", ChatUtil.GREEN).append(ChatUtil.getTrasnlateItemComponent(old).color(ChatUtil.BLUE).append(Component.text(" wurde von " + p.getName() + " Registriert.", ChatUtil.GREEN)))); } - ChatUtil.sendBrodCastMessage(Component.text("Neues Item: ", ChatUtil.GREEN).append(Component.translatable(item.translationKey(), ChatUtil.BLUE).append(Component.text(" (Es fehlen noch ", ChatUtil.GREEN).append(Component.text((itemcount - foundItems.size()), ChatUtil.BLUE).append(Component.text(" Items)", ChatUtil.GREEN)))))); + ChatUtil.sendBrodCastMessage(Component.text("Neues Item: ", ChatUtil.GREEN).append(ChatUtil.getTrasnlateItemComponent(item).color(ChatUtil.BLUE)).append(Component.text(" (Es fehlen noch ", ChatUtil.GREEN).append(Component.text((itemcount - foundItems.size()), ChatUtil.BLUE).append(Component.text(" Items)", ChatUtil.GREEN))))); for (Player pp : Bukkit.getOnlinePlayers()) { pp.playSound(pp.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1, 1); CubesideModUtils.sendFlashScreenToCubesideMod(plugin, pp, 50, ChatUtil.GREEN); diff --git a/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/BingoChallengeEvent.java b/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/BingoChallengeEvent.java index 730b5d4..6028658 100644 --- a/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/BingoChallengeEvent.java +++ b/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/BingoChallengeEvent.java @@ -217,7 +217,7 @@ playerMaterials.put(uuid, items); plugin.getScoreManager().updateScore(new ChallengePlayer(player.getUniqueId()), 1); - ChatUtil.sendMessage(player, Component.text("Item: ", ChatUtil.GREEN).append(Component.translatable(itemStack.getType().translationKey(), ChatUtil.BLUE).append(Component.text(" wurde Registriert", ChatUtil.GREEN)))); + ChatUtil.sendMessage(player, Component.text("Item: ", ChatUtil.GREEN).append(ChatUtil.getTrasnlateItemComponent(itemStack.getType()).color(ChatUtil.BLUE)).append(Component.text(" wurde Registriert", ChatUtil.GREEN))); player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1.0F, 2.0F); CubesideModUtils.sendFlashScreenToCubesideMod(plugin, player, 50, ChatUtil.GREEN); @@ -248,7 +248,7 @@ plugin.getScoreManager().updateScore(TeamUtils.getPlayerTeam(onlinePlayer), 1); scoreset = true; } - ChatUtil.sendMessage(onlinePlayer, Component.text("Item: ", ChatUtil.GREEN).append(Component.translatable(itemStack.getType().translationKey(), ChatUtil.BLUE).append(Component.text(" wurde Registriert", ChatUtil.GREEN)))); + ChatUtil.sendMessage(onlinePlayer, Component.text("Item: ", ChatUtil.GREEN).append(ChatUtil.getTrasnlateItemComponent(itemStack.getType()).color(ChatUtil.BLUE)).append(Component.text(" wurde Registriert", ChatUtil.GREEN))); onlinePlayer.playSound(onlinePlayer.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1.0F, 2.0F); CubesideModUtils.sendFlashScreenToCubesideMod(plugin, onlinePlayer, 50, ChatUtil.GREEN); diff --git a/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/DifferentItemsChallenge.java b/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/DifferentItemsChallenge.java index 818e35d..1d414ef 100644 --- a/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/DifferentItemsChallenge.java +++ b/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/DifferentItemsChallenge.java @@ -160,7 +160,7 @@ playerMaterialList.add(itemStack.getType()); playerMaterials.put(player.getUniqueId(), playerMaterialList); plugin.getScoreManager().updateScore(new ChallengePlayer(player.getUniqueId()), 1); - ChatUtil.sendMessage(player, Component.text("Item: ", ChatUtil.GREEN).append(Component.translatable(itemStack.getType().translationKey(), ChatUtil.BLUE).append(Component.text(" wurde Registriert", ChatUtil.GREEN)))); + ChatUtil.sendMessage(player, Component.text("Item: ", ChatUtil.GREEN).append(ChatUtil.getTrasnlateItemComponent(itemStack.getType()).color(ChatUtil.BLUE)).append(Component.text(" wurde Registriert", ChatUtil.GREEN))); player.playSound(player, Sound.BLOCK_NOTE_BLOCK_PLING, 1.0F, 2.0F); CubesideModUtils.sendFlashScreenToCubesideMod(plugin, player, 50, ChatUtil.GREEN); updateBossBar(); diff --git a/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/OreBattleChallengeEvent.java b/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/OreBattleChallengeEvent.java index 828ee8c..9a7bc56 100644 --- a/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/OreBattleChallengeEvent.java +++ b/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/OreBattleChallengeEvent.java @@ -110,7 +110,7 @@ } else { plugin.getScoreManager().updateScore(TeamUtils.getPlayerTeam(e.getPlayer()), blocklist.get(e.getBlock().getType())); } - ChatUtil.sendTitleToPlayer(e.getPlayer(), Component.empty(), Component.translatable(e.getBlock().getType().translationKey(), ChatUtil.BLUE).append(Component.text(" +" + blocklist.get(e.getBlock().getType()), ChatUtil.GREEN)), 3, 20, 3, false); + ChatUtil.sendTitleToPlayer(e.getPlayer(), Component.empty(), ChatUtil.getTrasnlateItemComponent(e.getBlock().getType()).color(ChatUtil.BLUE).append(Component.text(" +" + blocklist.get(e.getBlock().getType()), ChatUtil.GREEN)), 3, 20, 3, false); } } } @@ -124,7 +124,7 @@ } else { plugin.getScoreManager().updateScore(TeamUtils.getPlayerTeam(e.getPlayer()), -blocklist.get(e.getBlock().getType())); } - ChatUtil.sendTitleToPlayer(e.getPlayer(), Component.empty(), Component.translatable(e.getBlock().getType().translationKey(), ChatUtil.BLUE).append(Component.text(" -" + blocklist.get(e.getBlock().getType()), ChatUtil.RED)), 3, 20, 3, false); + ChatUtil.sendTitleToPlayer(e.getPlayer(), Component.empty(), ChatUtil.getTrasnlateItemComponent(e.getBlock().getType()).color(ChatUtil.BLUE).append(Component.text(" -" + blocklist.get(e.getBlock().getType()), ChatUtil.RED)), 3, 20, 3, false); } } } diff --git a/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/SammelFieberChallengeEvent.java b/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/SammelFieberChallengeEvent.java index 8a9148b..ba71e4e 100644 --- a/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/SammelFieberChallengeEvent.java +++ b/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/SammelFieberChallengeEvent.java @@ -94,7 +94,7 @@ if (isSinglePlayer()) { updatePlayerBossBar(); } else { - bossBar = BossBar.bossBar(Component.text("Es wurden ", ChatUtil.GREEN).append(Component.text(count + " ", ChatUtil.BLUE)).append(Component.translatable(getMaterial().translationKey(), ChatUtil.BLUE).append(Component.text(" abgegeben. Das sind ", ChatUtil.GREEN).append(Component.text(count * SammelFieberSettingsGui.MONEY + " Cubes", ChatUtil.BLUE)))), 1.0f, BossBar.Color.GREEN, BossBar.Overlay.PROGRESS); + bossBar = BossBar.bossBar(Component.text("Es wurden ", ChatUtil.GREEN).append(Component.text(count + " ", ChatUtil.BLUE)).append(ChatUtil.getTrasnlateItemComponent(getMaterial()).color(ChatUtil.BLUE).append(Component.text(" abgegeben. Das sind ", ChatUtil.GREEN).append(Component.text(count * SammelFieberSettingsGui.MONEY + " Cubes", ChatUtil.BLUE)))), 1.0f, BossBar.Color.GREEN, BossBar.Overlay.PROGRESS); for (Player pp : Bukkit.getOnlinePlayers()) { plugin.getScoreManager().join(new ChallengePlayer(pp.getUniqueId())); bossBar.addViewer(pp); @@ -103,7 +103,7 @@ } else { for (ChallengeTeam team : TeamUtils.getTeams()) { plugin.getScoreManager().join(team); - BossBar teamBar = BossBar.bossBar(Component.text("Dein Team hat ", ChatUtil.GREEN).append(Component.text(plugin.getScoreManager().getScore(team) + " ", ChatUtil.BLUE)).append(Component.translatable(getMaterial().translationKey(), ChatUtil.BLUE).append(Component.text(" abgegeben. ", ChatUtil.GREEN).append(Component.text(" | ", ChatUtil.RED)).append(Component.text("Platz: " + plugin.getScoreManager().getPosition(team), ChatUtil.GREEN)))), 1.0f, BossBar.Color.GREEN, BossBar.Overlay.PROGRESS); + BossBar teamBar = BossBar.bossBar(Component.text("Dein Team hat ", ChatUtil.GREEN).append(Component.text(plugin.getScoreManager().getScore(team) + " ", ChatUtil.BLUE)).append(ChatUtil.getTrasnlateItemComponent(getMaterial()).color(ChatUtil.BLUE).append(Component.text(" abgegeben. ", ChatUtil.GREEN).append(Component.text(" | ", ChatUtil.RED)).append(Component.text("Platz: " + plugin.getScoreManager().getPosition(team), ChatUtil.GREEN)))), 1.0f, BossBar.Color.GREEN, BossBar.Overlay.PROGRESS); bossBarList.put(team, teamBar); for (OfflinePlayer offlinePlayer : TeamUtils.getPlayersInTeam(team)) if (offlinePlayer instanceof Player player) { @@ -153,7 +153,7 @@ if (isSinglePlayer()) { updatePlayerBossBar(); } else { - bossBar.name(Component.text("Es wurden ", ChatUtil.GREEN).append(Component.text(count + " ", ChatUtil.BLUE)).append(Component.translatable(getMaterial().translationKey(), ChatUtil.BLUE).append(Component.text(" abgegeben. Das sind ", ChatUtil.GREEN).append(Component.text(count * SammelFieberSettingsGui.MONEY + " Cubes", ChatUtil.BLUE))))); + bossBar.name(Component.text("Es wurden ", ChatUtil.GREEN).append(Component.text(count + " ", ChatUtil.BLUE)).append(ChatUtil.getTrasnlateItemComponent(getMaterial()).color(ChatUtil.BLUE)).append(Component.text(" abgegeben. Das sind ", ChatUtil.GREEN).append(Component.text(count * SammelFieberSettingsGui.MONEY + " Cubes", ChatUtil.BLUE)))); } } else { ChallengeTeam team = TeamUtils.getTeam(meta.getDisplayName()); @@ -168,7 +168,7 @@ for (ChallengeTeam tempTema : TeamUtils.getTeams()) { BossBar teamBar = bossBarList.get(tempTema); - teamBar.name(Component.text("Dein Team hat ", ChatUtil.GREEN).append(Component.text(plugin.getScoreManager().getScore(tempTema) + " ", ChatUtil.BLUE)).append(Component.translatable(getMaterial().translationKey(), ChatUtil.BLUE).append(Component.text(" abgegeben. ", ChatUtil.GREEN).append(Component.text(" | ", ChatUtil.RED)).append(Component.text("Platz: " + plugin.getScoreManager().getPosition(tempTema), ChatUtil.GREEN))))); + teamBar.name(Component.text("Dein Team hat ", ChatUtil.GREEN).append(Component.text(plugin.getScoreManager().getScore(tempTema) + " ", ChatUtil.BLUE)).append(ChatUtil.getTrasnlateItemComponent(getMaterial()).color(ChatUtil.BLUE)).append(Component.text(" abgegeben. ", ChatUtil.GREEN).append(Component.text(" | ", ChatUtil.RED)).append(Component.text("Platz: " + plugin.getScoreManager().getPosition(tempTema), ChatUtil.GREEN)))); } } } @@ -181,7 +181,7 @@ ChallengePlayer challengePlayer = new ChallengePlayer(pp.getUniqueId()); plugin.getScoreManager().join(challengePlayer); - Component component = Component.text("Du hast ", ChatUtil.GREEN).append(Component.text(plugin.getScoreManager().getScore(challengePlayer) + " ", ChatUtil.BLUE).append(Component.translatable(getMaterial().translationKey(), ChatUtil.BLUE).append(Component.text(" abgegeben.", ChatUtil.GREEN).append(Component.text(" | ", ChatUtil.RED).append(Component.text("Platzierung: " + plugin.getScoreManager().getPosition(challengePlayer), ChatUtil.GREEN)))))); + Component component = Component.text("Du hast ", ChatUtil.GREEN).append(Component.text(plugin.getScoreManager().getScore(challengePlayer) + " ", ChatUtil.BLUE).append(ChatUtil.getTrasnlateItemComponent(getMaterial()).color(ChatUtil.BLUE)).append(Component.text(" abgegeben.", ChatUtil.GREEN).append(Component.text(" | ", ChatUtil.RED).append(Component.text("Platzierung: " + plugin.getScoreManager().getPosition(challengePlayer), ChatUtil.GREEN))))); if (bossBarPlayerList.containsKey(pp.getUniqueId())) { BossBar playerBar = bossBarPlayerList.get(pp.getUniqueId()); playerBar.name(component); @@ -306,7 +306,7 @@ if (bossBarList.containsKey(team)) { bossBarList.get(team).addViewer(e.getPlayer()); } else { - Component component = Component.text("Dein Team hat ", ChatUtil.GREEN).append(Component.text(plugin.getScoreManager().getScore(team) + " ", ChatUtil.BLUE)).append(Component.translatable(getMaterial().translationKey(), ChatUtil.BLUE).append(Component.text(" abgegeben. ", ChatUtil.GREEN).append(Component.text(" | ", ChatUtil.RED)).append(Component.text("Platz: " + plugin.getScoreManager().getPosition(team), ChatUtil.GREEN)))); + Component component = Component.text("Dein Team hat ", ChatUtil.GREEN).append(Component.text(plugin.getScoreManager().getScore(team) + " ", ChatUtil.BLUE)).append(ChatUtil.getTrasnlateItemComponent(getMaterial()).color(ChatUtil.BLUE)).append(Component.text(" abgegeben. ", ChatUtil.GREEN).append(Component.text(" | ", ChatUtil.RED)).append(Component.text("Platz: " + plugin.getScoreManager().getPosition(team), ChatUtil.GREEN))); BossBar teamBar = BossBar.bossBar(component, 1.0f, BossBar.Color.GREEN, BossBar.Overlay.PROGRESS); bossBarList.put(team, teamBar); teamBar.addViewer(e.getPlayer()); diff --git a/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/forcequest/ForceQuestChallengeEvent.java b/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/forcequest/ForceQuestChallengeEvent.java index 43b0b27..b5cbf5d 100644 --- a/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/forcequest/ForceQuestChallengeEvent.java +++ b/src/main/java/de/fanta/challenges/challenges/ChallengeEvents/forcequest/ForceQuestChallengeEvent.java @@ -837,7 +837,7 @@ ArrayList itemList = playerMaterials.get(player.getUniqueId()); itemList.remove(pickupItem); playerMaterials.put(player.getUniqueId(), itemList); - TextComponent textComponent = Component.text("Item: ").color(ChatUtil.GREEN).append(Component.translatable(pickupItem.translationKey()).color(ChatUtil.BLUE)).append(Component.text(" wurde Registriert").color(ChatUtil.GREEN)); + TextComponent textComponent = Component.text("Item: ").color(ChatUtil.GREEN).append(ChatUtil.getTrasnlateItemComponent(pickupItem).color(ChatUtil.BLUE)).append(Component.text(" wurde Registriert").color(ChatUtil.GREEN)); ChatUtil.sendMessage(player, textComponent); finishQuest(player); return true; @@ -926,14 +926,7 @@ case ForceItem -> { Material material = itemByPlayerList.get(player.getUniqueId()); if (material != null) { - TranslatableComponent component = Component.translatable(material.translationKey()); - if (material.name().toLowerCase().contains("music_disc")) { - component = component.append(Component.text(" " + StringUtil.capitalizeFirstLetter(material.name().toLowerCase().replace("music_disc_", ""), true))); - } - - if (material.name().toLowerCase().contains("banner_pattern")) { - component = component.append(Component.text(" " + StringUtil.capitalizeFirstLetter(material.name().toLowerCase().replace("_banner_pattern", ""), true))); - } + Component component = Component.empty().append(ChatUtil.getTrasnlateItemComponent(material)); bossBarTitle = getBossBarTitle(">> ForceItem: ", component, scoreManager.getPosition(new ChallengePlayer(player.getUniqueId()))); } @@ -983,7 +976,7 @@ } } - private static TextComponent getBossBarTitle(String title, TranslatableComponent name, int pos) { + private static TextComponent getBossBarTitle(String title, Component name, int pos) { return Component.text(title).color(ChatUtil.GREEN).append(name.color(ChatUtil.BLUE).append(Component.text(" << | Position: ").color(ChatUtil.GREEN)).append(Component.text(pos).color(ChatUtil.BLUE))); } diff --git a/src/main/java/de/fanta/challenges/listeners/QuitJoinListener.java b/src/main/java/de/fanta/challenges/listeners/QuitJoinListener.java index f45c408..b7803d5 100644 --- a/src/main/java/de/fanta/challenges/listeners/QuitJoinListener.java +++ b/src/main/java/de/fanta/challenges/listeners/QuitJoinListener.java @@ -39,7 +39,7 @@ } if (!plugin.getVanish().isVanish(p)) { - e.joinMessage(p.name().color(ChatUtil.BLUE).append(Component.text(" hat die Lobby betreten! ", ChatUtil.GREEN).append(Component.text("[" + (Bukkit.getServer().getOnlinePlayers().size() - plugin.getVanish().countVanishPlayers()) + "/" + Bukkit.getServer().getMaxPlayers() + "]", ChatUtil.YELLOW)))); + e.joinMessage(plugin.getPrefixComponent().append(p.name().color(ChatUtil.BLUE).append(Component.text(" hat die Lobby betreten! ", ChatUtil.GREEN).append(Component.text("[" + (Bukkit.getServer().getOnlinePlayers().size() - plugin.getVanish().countVanishPlayers()) + "/" + Bukkit.getServer().getMaxPlayers() + "]", ChatUtil.YELLOW))))); plugin.addstatisticPlayers(p.getUniqueId()); if (plugin.getServerType() != ServerType.ADVENTURE) { if (!DeathrunChallengeEvent.getDeadPlayer().contains(p.getUniqueId())) { @@ -139,7 +139,7 @@ } } if (!plugin.getVanish().isVanish(player)) { - e.quitMessage(player.name().color(ChatUtil.BLUE).append(Component.text(" hat die Lobby verlassen! ", ChatUtil.RED).append(Component.text("[" + (Bukkit.getServer().getOnlinePlayers().size() - plugin.getVanish().countVanishPlayers() - 1) + "/" + Bukkit.getServer().getMaxPlayers() + "]", ChatUtil.YELLOW)))); + e.quitMessage(plugin.getPrefixComponent().append(player.name().color(ChatUtil.BLUE).append(Component.text(" hat die Lobby verlassen! ", ChatUtil.RED).append(Component.text("[" + (Bukkit.getServer().getOnlinePlayers().size() - plugin.getVanish().countVanishPlayers() - 1) + "/" + Bukkit.getServer().getMaxPlayers() + "]", ChatUtil.YELLOW))))); this.plugin.getSBManager().removeScoreboard(player); Bukkit.getPluginManager().callEvent(new PlayerCountChangedEvent(Bukkit.getOnlinePlayers().size() - plugin.getVanish().countVanishPlayers() - 1)); diff --git a/src/main/java/de/fanta/challenges/utils/ChatUtil.java b/src/main/java/de/fanta/challenges/utils/ChatUtil.java index 20309b2..5b8703b 100644 --- a/src/main/java/de/fanta/challenges/utils/ChatUtil.java +++ b/src/main/java/de/fanta/challenges/utils/ChatUtil.java @@ -1,11 +1,14 @@ package de.fanta.challenges.utils; import de.fanta.challenges.Challenges; +import de.iani.cubesideutils.StringUtil; import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.TranslatableComponent; import net.kyori.adventure.text.format.TextColor; import net.kyori.adventure.title.Title; import net.kyori.adventure.util.Ticks; import org.bukkit.Bukkit; +import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -79,4 +82,21 @@ player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1.0F, 2.0F); } } + + public static Component getTrasnlateItemComponent(Material material) { + TranslatableComponent component = Component.translatable(material.translationKey()); + if (material.name().toLowerCase().contains("music_disc")) { + component = component.append(Component.text(" " + StringUtil.capitalizeFirstLetter(material.name().toLowerCase().replace("music_disc_", ""), true))); + } + + if (material.name().toLowerCase().contains("banner_pattern")) { + component = component.append(Component.text(" " + StringUtil.capitalizeFirstLetter(material.name().toLowerCase().replace("_banner_pattern", ""), true))); + } + + if (material.name().toLowerCase().contains("smithing_template")) { + component = component.append(Component.text(" " + StringUtil.capitalizeFirstLetter(material.name().toLowerCase().replace("_smithing_template", ""), true))); + } + + return component; + } }