Skip to content

Commit

Permalink
Fix WesJD#365
Browse files Browse the repository at this point in the history
  • Loading branch information
Gypopo committed Jan 21, 2025
1 parent 76d28a9 commit 5715c80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/src/main/java/net/wesjd/anvilgui/AnvilGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public void setTitle(String literalTitle, boolean preserveRenameText) {
Validate.notNull(literalTitle, "literalTitle cannot be null");
if (VersionMatcher.requiresMini)
literalTitle = MiniMessage.miniMessage()
.serialize(LegacyComponentSerializer.legacyAmpersand().deserialize(title.replace('§', '&')));
.serialize(LegacyComponentSerializer.legacyAmpersand().deserialize(literalTitle.replace('§', '&')));

setTitle(WRAPPER.literalChatComponent(literalTitle), preserveRenameText);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ private static boolean needsMiniMessage() {
String craftBukkitPackage = Bukkit.getServer().getClass().getPackage().getName();
if (!craftBukkitPackage.contains(".v")) { // cb package not relocated (i.e. paper 1.20.5+)
try {
int version = Integer.parseInt(Bukkit.getBukkitVersion().split("-")[0].replace(".", ""));
int version =
Integer.parseInt(Bukkit.getBukkitVersion().split("-")[0].replace(".", ""));

if (version >= 1214) // Check for server version above or equal to 1.21.4
return true;
} catch (NumberFormatException e) {} // Invalid version number
return true;
} catch (NumberFormatException e) {
} // Invalid version number
}

return false;
Expand Down

0 comments on commit 5715c80

Please sign in to comment.