Fixes a couple of bugs which prevented portals using spaces in the name from being properly connected

This commit is contained in:
Kristian Knarvik 2021-11-13 03:44:27 +01:00
parent 351d1762e7
commit a84210d550
2 changed files with 3 additions and 2 deletions

View File

@ -98,7 +98,7 @@ public class PortalActivator {
* @param destination <p>The new destination of this portal activator's portal</p> * @param destination <p>The new destination of this portal activator's portal</p>
*/ */
public void setDestination(Portal destination) { public void setDestination(Portal destination) {
setDestination(destination.getCleanName()); setDestination(destination.getName());
} }
/** /**

View File

@ -257,7 +257,8 @@ 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.getDestinationName(), portal.getNetwork()); Portal destination = PortalHandler.getByName(Portal.cleanString(portal.getDestinationName()),
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"));
} else { } else {