From a66bfe5b56dc860aa4c2bc1b4305973829211a19 Mon Sep 17 00:00:00 2001 From: Mgazul Date: Tue, 3 Sep 2024 03:11:37 +0800 Subject: [PATCH] Use Code AI fix some code --- .../org/bukkit/craftbukkit/enchantments/CraftEnchantment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java index 4970ff199d..9c47dee48c 100644 --- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java +++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java @@ -137,13 +137,13 @@ private static String generateName(net.minecraft.enchantment.Enchantment target) if (StringUtils.containsIgnoreCase(candidate, "Enchantment")) { candidate = candidate.replaceFirst("[E|e]nchantment", ""); // Add underscores at camelCase humps - candidate = candidate.replaceAll("([a-z])([A-Z])", "\1_\2").toUpperCase(); + candidate = candidate.replaceAll("([a-z])([A-Z])", "$1_$2").toUpperCase(); candidate = addSuffix(candidate.toUpperCase()); return candidate; } // fall back to the FQN if naming pattern is broken candidate = clz.getName(); - candidate = candidate.replaceAll("([a-z])([A-Z])", "\1_\2"); + candidate = candidate.replaceAll("([a-z])([A-Z])", "$1_$2"); candidate = candidate.replaceAll("\\.", "_"); candidate = addSuffix(candidate.toUpperCase()); return candidate;