Skip to content

Commit

Permalink
Use Code AI fix some code
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Sep 2, 2024
1 parent a71cc78 commit a66bfe5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

1 comment on commit a66bfe5

@Mgazul
Copy link
Contributor Author

@Mgazul Mgazul commented on a66bfe5 Sep 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Please sign in to comment.