Skip to content

Commit

Permalink
Fixes an issue when color codes were left into UUID's.
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed Dec 1, 2021
1 parent f36f5be commit 649211e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<powermock.version>2.0.2</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.17-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.17.2</bentobox.version>
<bentobox.version>1.17.3</bentobox.version>
<level.version>2.5.0</level.version>
<!-- Vault API version -->
<vault.version>1.7</vault.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package world.bentobox.magiccobblestonegenerator.utils;


import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Biome;
Expand Down Expand Up @@ -294,13 +295,16 @@ public static <T> TreeMap<Double, T> pairList2TreeMap(List<Pair<T, Double>> pair

/**
* Sanitizes the provided input. It replaces spaces and hyphens with underscores and lower cases the input.
*
* This code also removes all color codes from the input.
* @param input input to sanitize
* @return sanitized input
*/
public static String sanitizeInput(String input)
{
return input.toLowerCase(Locale.ENGLISH).replace(" ", "_").replace("-", "_");
return ChatColor.stripColor(
Util.translateColorCodes(input.toLowerCase(Locale.ENGLISH).
replace(" ", "_").
replace("-", "_")));
}


Expand Down

0 comments on commit 649211e

Please sign in to comment.