Skip to content

Commit

Permalink
1.20.5: renamed enum constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Brokkonaut committed Apr 25, 2024
1 parent 090e333 commit bf56b33
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 56 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -61,7 +61,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<version>1.20.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

Expand Down
38 changes: 19 additions & 19 deletions src/main/java/com/Acrobot/Breeze/Utils/EnchantmentNames.java
Expand Up @@ -10,27 +10,27 @@ public class EnchantmentNames {
static {
enchantmentToName = new HashMap<Enchantment, String>();

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");
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/Acrobot/Breeze/Utils/PotionNames.java
Expand Up @@ -9,7 +9,7 @@ public class PotionNames {
static {
potionToName = new HashMap<PotionType, String>();

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");
Expand All @@ -19,27 +19,27 @@ 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");
addEnchantment(PotionType.LONG_SLOWNESS, "Extended Potion of Slowness");
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");
Expand All @@ -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) {
Expand Down
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
Expand Down
Expand Up @@ -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;
Expand Down

0 comments on commit bf56b33

Please sign in to comment.