Skip to content

Commit

Permalink
Normalize CRLF mod description line endings to use LF instead (#26)
Browse files Browse the repository at this point in the history
Minecraft can't properly display CRLF line endings in its GUIs. This leads to them being shown as characters in mod descriptions on the NeoForge mod list screen.
  • Loading branch information
Su5eD authored Oct 16, 2023
1 parent 06ce743 commit ea1e834
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public ModInfo(final ModFileInfo owningFile, final IConfigurable config)
this.displayName = config.<String>getConfigElement("displayName")
.orElse(this.modId);
this.description = config.<String>getConfigElement("description")
// Normalize CRLF line endings to use LF instead
.map(desc -> desc.replace("\r\n", "\n"))
.orElse("MISSING DESCRIPTION");
this.logoFile = Optional.ofNullable(config.<String>getConfigElement("logoFile")
.orElseGet(() -> ownFile.flatMap(mf -> mf.<String>getConfigElement("logoFile"))
Expand Down

0 comments on commit ea1e834

Please sign in to comment.