Removes the replacement of spaces to underscores for the cleanString method
Some checks failed
EpicKnarvik97/Stargate/pipeline/head There was a failure building this commit

This commit is contained in:
Kristian Knarvik 2021-11-13 17:04:13 +01:00
parent e1a3d2d560
commit 51f5420f9e
2 changed files with 3 additions and 4 deletions

View File

@ -304,8 +304,7 @@ public class Portal {
* @return <p>The clean string</p> * @return <p>The clean string</p>
*/ */
public static String cleanString(String string) { public static String cleanString(String string) {
string = ChatColor.stripColor(ChatColor.translateAlternateColorCodes('&', string)); return ChatColor.stripColor(ChatColor.translateAlternateColorCodes('&', string)).toLowerCase();
return string.toLowerCase().replace(' ', '_');
} }
@Override @Override

View File

@ -247,7 +247,7 @@ public class PortalSignDrawer {
* @param sign <p>The sign to re-draw</p> * @param sign <p>The sign to re-draw</p>
*/ */
private void drawFixedSign(Sign sign) { private void drawFixedSign(Sign sign) {
Portal destinationPortal = PortalHandler.getByName(Portal.cleanString(portal.getDestinationName()), Portal destinationPortal = PortalHandler.getByName(Portal.cleanString(portal.getDestinationName()),
portal.getCleanNetwork()); portal.getCleanNetwork());
String destinationName = portal.getOptions().isRandom() ? Stargate.getString("signRandom") : String destinationName = portal.getOptions().isRandom() ? Stargate.getString("signRandom") :
(destinationPortal != null ? destinationPortal.getName() : portal.getDestinationName()); (destinationPortal != null ? destinationPortal.getName() : portal.getDestinationName());
@ -259,7 +259,7 @@ public class PortalSignDrawer {
setLine(sign, 2, highlightColor + "(" + mainColor + fixColor(portal.getNetwork()) + setLine(sign, 2, highlightColor + "(" + mainColor + fixColor(portal.getNetwork()) +
highlightColor + ")"); highlightColor + ")");
} }
Portal destination = PortalHandler.getByName(Portal.cleanString(portal.getDestinationName()), Portal destination = PortalHandler.getByName(Portal.cleanString(portal.getDestinationName()),
portal.getNetwork()); portal.getNetwork());
if (destination == null && !portal.getOptions().isRandom()) { if (destination == null && !portal.getOptions().isRandom()) {
setLine(sign, 3, errorColor + Stargate.getString("signDisconnected")); setLine(sign, 3, errorColor + Stargate.getString("signDisconnected"));