Fix italicized potion names

This commit is contained in:
nossr50
2024-05-11 15:27:47 -07:00
parent 07b4736be3
commit b3edca5304
2 changed files with 13 additions and 12 deletions

View File

@ -259,18 +259,17 @@ public class PotionConfig extends LegacyConfigLoader {
private void setPotionDisplayName(ConfigurationSection section, PotionMeta potionMeta) {
String configuredName = section.getString("Name", null);
if (configuredName != null) {
potionMeta.setDisplayName(configuredName);
return;
}
// Potion is water, but has effects
if (isPotionTypeWater(potionMeta)
&& (PotionUtil.hasBasePotionEffects(potionMeta) || !potionMeta.getCustomEffects().isEmpty())) {
// If we don't set a name for these potions, they will simply be called "Water Potion"
final String name = section.getName().toUpperCase().replace("_", " ");
potionMeta.setDisplayName(name);
System.out.println("DEBUG: Renaming potion to " + name);
potionMeta.setItemName(configuredName);
}
//
// // Potion is water, but has effects
// if (isPotionTypeWater(potionMeta)
// && (PotionUtil.hasBasePotionEffects(potionMeta) || !potionMeta.getCustomEffects().isEmpty())) {
// // If we don't set a name for these potions, they will simply be called "Water Potion"
// final String name = section.getName().toUpperCase().replace("_", " ");
// potionMeta.setDisplayName(name);
// System.out.println("DEBUG: Renaming potion to " + name);
// }
}
/**