diff --git a/pom.xml b/pom.xml
index cfea70a5a..4eb2587e9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -61,7 +61,7 @@
org.spigotmc
spigot-api
- 1.20.4-R0.1-SNAPSHOT
+ 1.20.5-R0.1-SNAPSHOT
provided
diff --git a/src/main/java/com/Acrobot/Breeze/Utils/EnchantmentNames.java b/src/main/java/com/Acrobot/Breeze/Utils/EnchantmentNames.java
index 217f1ac80..b74339c1a 100644
--- a/src/main/java/com/Acrobot/Breeze/Utils/EnchantmentNames.java
+++ b/src/main/java/com/Acrobot/Breeze/Utils/EnchantmentNames.java
@@ -10,27 +10,27 @@ public class EnchantmentNames {
static {
enchantmentToName = new HashMap();
- addEnchantment(Enchantment.ARROW_DAMAGE, "Power");
- addEnchantment(Enchantment.ARROW_FIRE, "Flame");
- addEnchantment(Enchantment.ARROW_INFINITE, "Infinity");
- addEnchantment(Enchantment.ARROW_KNOCKBACK, "Punch");
+ addEnchantment(Enchantment.POWER, "Power");
+ addEnchantment(Enchantment.FLAME, "Flame");
+ addEnchantment(Enchantment.INFINITY, "Infinity");
+ addEnchantment(Enchantment.PUNCH, "Punch");
addEnchantment(Enchantment.BINDING_CURSE, ChatColor.RED + "Curse of Binding");
- addEnchantment(Enchantment.DAMAGE_ALL, "Sharpness");
- addEnchantment(Enchantment.DAMAGE_ARTHROPODS, "Bane of Arthropods");
- addEnchantment(Enchantment.DAMAGE_UNDEAD, "Smite");
- addEnchantment(Enchantment.DIG_SPEED, "Efficiency");
- addEnchantment(Enchantment.DURABILITY, "Unbreaking");
- addEnchantment(Enchantment.LOOT_BONUS_BLOCKS, "Fortune");
- addEnchantment(Enchantment.LOOT_BONUS_MOBS, "Looting");
- addEnchantment(Enchantment.LUCK, "Luck of the Sea");
- addEnchantment(Enchantment.OXYGEN, "Respiration");
- addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, "Protection");
- addEnchantment(Enchantment.PROTECTION_EXPLOSIONS, "Blast Protection");
- addEnchantment(Enchantment.PROTECTION_FALL, "Feather Falling");
- addEnchantment(Enchantment.PROTECTION_FIRE, "Fire Protection");
- addEnchantment(Enchantment.PROTECTION_PROJECTILE, "Projectile Protection");
+ addEnchantment(Enchantment.SHARPNESS, "Sharpness");
+ addEnchantment(Enchantment.BANE_OF_ARTHROPODS, "Bane of Arthropods");
+ addEnchantment(Enchantment.SMITE, "Smite");
+ addEnchantment(Enchantment.EFFICIENCY, "Efficiency");
+ addEnchantment(Enchantment.UNBREAKING, "Unbreaking");
+ addEnchantment(Enchantment.FORTUNE, "Fortune");
+ addEnchantment(Enchantment.LOOTING, "Looting");
+ addEnchantment(Enchantment.LUCK_OF_THE_SEA, "Luck of the Sea");
+ addEnchantment(Enchantment.RESPIRATION, "Respiration");
+ addEnchantment(Enchantment.PROTECTION, "Protection");
+ addEnchantment(Enchantment.BLAST_PROTECTION, "Blast Protection");
+ addEnchantment(Enchantment.FEATHER_FALLING, "Feather Falling");
+ addEnchantment(Enchantment.FIRE_PROTECTION, "Fire Protection");
+ addEnchantment(Enchantment.PROJECTILE_PROTECTION, "Projectile Protection");
addEnchantment(Enchantment.VANISHING_CURSE, ChatColor.RED + "Curse of Vanishing");
- addEnchantment(Enchantment.WATER_WORKER, "Aqua Affinity");
+ addEnchantment(Enchantment.AQUA_AFFINITY, "Aqua Affinity");
addEnchantment(Enchantment.LOYALTY, "Loyalty");
addEnchantment(Enchantment.IMPALING, "Impaling");
addEnchantment(Enchantment.RIPTIDE, "Riptide");
diff --git a/src/main/java/com/Acrobot/Breeze/Utils/PotionNames.java b/src/main/java/com/Acrobot/Breeze/Utils/PotionNames.java
index 02f969390..b1c622499 100644
--- a/src/main/java/com/Acrobot/Breeze/Utils/PotionNames.java
+++ b/src/main/java/com/Acrobot/Breeze/Utils/PotionNames.java
@@ -9,7 +9,7 @@ public class PotionNames {
static {
potionToName = new HashMap();
- addEnchantment(PotionType.UNCRAFTABLE, "Uncraftable Potion");
+ // addEnchantment(PotionType.UNCRAFTABLE, "Uncraftable Potion");
addEnchantment(PotionType.WATER, "Water Bottle");
addEnchantment(PotionType.MUNDANE, "Mundane Potion");
addEnchantment(PotionType.THICK, "Thick Potion");
@@ -19,12 +19,12 @@ public class PotionNames {
addEnchantment(PotionType.LONG_NIGHT_VISION, "Extended Potion of Night Vision");
addEnchantment(PotionType.INVISIBILITY, "Potion of Invisibility");
addEnchantment(PotionType.LONG_INVISIBILITY, "Extended Potion of Invisibility");
- addEnchantment(PotionType.JUMP, "Potion of Leaping");
+ addEnchantment(PotionType.LEAPING, "Potion of Leaping");
addEnchantment(PotionType.LONG_LEAPING, "Extended Potion of Leaping");
addEnchantment(PotionType.STRONG_LEAPING, "Potion of Leaping II");
addEnchantment(PotionType.FIRE_RESISTANCE, "Potion of Fire Resistance");
addEnchantment(PotionType.LONG_FIRE_RESISTANCE, "Extended Potion of Fire Resistance");
- addEnchantment(PotionType.SPEED, "Potion of Swiftness");
+ addEnchantment(PotionType.SWIFTNESS, "Potion of Swiftness");
addEnchantment(PotionType.LONG_SWIFTNESS, "Extended Potion of Swiftness");
addEnchantment(PotionType.STRONG_SWIFTNESS, "Potion of Swiftness II");
addEnchantment(PotionType.SLOWNESS, "Potion of Slowness");
@@ -32,14 +32,14 @@ public class PotionNames {
addEnchantment(PotionType.STRONG_SLOWNESS, "Potion of Slowness IV");
addEnchantment(PotionType.WATER_BREATHING, "Potion of Water Breathing");
addEnchantment(PotionType.LONG_WATER_BREATHING, "Extended Potion of Water Breathing");
- addEnchantment(PotionType.INSTANT_HEAL, "Potion of Healing");
+ addEnchantment(PotionType.HEALING, "Potion of Healing");
addEnchantment(PotionType.STRONG_HEALING, "Potion of Healing II");
- addEnchantment(PotionType.INSTANT_DAMAGE, "Potion of Harming");
+ addEnchantment(PotionType.HARMING, "Potion of Harming");
addEnchantment(PotionType.STRONG_HARMING, "Potion of Harming II");
addEnchantment(PotionType.POISON, "Potion of Poison");
addEnchantment(PotionType.LONG_POISON, "Extended Potion of Poison");
addEnchantment(PotionType.STRONG_POISON, "Potion of Poison II");
- addEnchantment(PotionType.REGEN, "Potion of Regeneration");
+ addEnchantment(PotionType.REGENERATION, "Potion of Regeneration");
addEnchantment(PotionType.LONG_REGENERATION, "Extended Potion of Regeneration");
addEnchantment(PotionType.STRONG_REGENERATION, "Potion of Regeneration II");
addEnchantment(PotionType.STRENGTH, "Potion of Strength");
@@ -61,7 +61,7 @@ private static void addEnchantment(PotionType potion, String name) {
public static String getName(PotionType potion) {
if (potion == null) {
- return null;
+ return "Uncraftable Potion";
}
String name = potionToName.get(potion);
if (name != null) {
diff --git a/src/main/java/com/Acrobot/ChestShop/Listeners/ItemInfoListener.java b/src/main/java/com/Acrobot/ChestShop/Listeners/ItemInfoListener.java
index c8a1ba6dd..97598b7e3 100644
--- a/src/main/java/com/Acrobot/ChestShop/Listeners/ItemInfoListener.java
+++ b/src/main/java/com/Acrobot/ChestShop/Listeners/ItemInfoListener.java
@@ -45,7 +45,6 @@
import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.inventory.meta.TropicalFishBucketMeta;
import org.bukkit.inventory.meta.trim.ArmorTrim;
-import org.bukkit.potion.PotionData;
import org.bukkit.potion.PotionEffect;
/**
@@ -217,37 +216,17 @@ public static void addInfo(ItemInfoEvent event) {
ItemMeta arrowMeta = stack.getItemMeta();
if (arrowMeta instanceof PotionMeta potion) {
StringBuilder message = new StringBuilder(50).append(" (");
- boolean first = true;
- PotionData base = potion.getBasePotionData();
- if (base != null) {
- if (base.isExtended()) {
- message.append("Extended ");
- }
- if (type == Material.SPLASH_POTION) {
- message.append("Splash ");
- }
- if (type == Material.LINGERING_POTION) {
- message.append("Lingering ");
- }
- message.append(PotionNames.getName(base.getType()));
- if (base.isUpgraded()) {
- message.append(" II");
- }
- first = false;
- }
+ String baseItemName = StringUtil.capitalizeFirstLetter(type.name(), '_');
+ String itemName = PotionNames.getName(potion.getBasePotionType()).replace("Potion", baseItemName);
+ message.append(itemName);
if (potion.hasCustomEffects()) {
for (PotionEffect effect : potion.getCustomEffects()) {
- if (!first) {
- message.append(", ");
- }
- first = false;
+ message.append(", ");
message.append(ChatColor.GRAY + capitalizeFirstLetter(effect.getType().getName(), '_') + ' ' + toTime(effect.getDuration() / 20));
}
}
- if (!first) {
- message.append(")");
- arrow = arrow + message.toString();
- }
+ message.append(")");
+ arrow = arrow + message.toString();
}
sender.sendMessage(" " + ChatColor.GRAY + "Projectile: " + arrow);
}
@@ -258,7 +237,7 @@ public static void addInfo(ItemInfoEvent event) {
if (meta instanceof MusicInstrumentMeta musicInstrumentMeta) {
MusicInstrument instrumentType = musicInstrumentMeta.getInstrument();
if (instrumentType == null) {
- instrumentType = MusicInstrument.PONDER;
+ instrumentType = MusicInstrument.PONDER_GOAT_HORN;
}
String instrument = StringUtil.capitalizeFirstLetter(instrumentType.getKey().getKey().replace("_goat_horn", ""));
sender.sendMessage(" " + ChatColor.GRAY + "Instrument: " + instrument);
diff --git a/src/main/java/com/Acrobot/ChestShop/Utils/ItemNamingUtils.java b/src/main/java/com/Acrobot/ChestShop/Utils/ItemNamingUtils.java
index 8083da222..2e506a658 100644
--- a/src/main/java/com/Acrobot/ChestShop/Utils/ItemNamingUtils.java
+++ b/src/main/java/com/Acrobot/ChestShop/Utils/ItemNamingUtils.java
@@ -45,7 +45,7 @@ public static String getDisplayName(ItemStack itemStack, int length) {
if (itemMeta instanceof MusicInstrumentMeta musicInstrumentMeta) {
MusicInstrument instrumentType = musicInstrumentMeta.getInstrument();
if (instrumentType == null) {
- instrumentType = MusicInstrument.PONDER;
+ instrumentType = MusicInstrument.PONDER_GOAT_HORN;
}
String instrument = StringUtil.capitalizeFirstLetter(instrumentType.getKey().getKey().replace("_goat_horn", ""));
itemName = itemName + " " + instrument;