Makes portal names and networks case and color-insensitive and increases length limit to 13. #17

Ignores &[0-9a-f] color codes when counting towards the name and network string limits
Makes portal lists store cleaned portal and network names to ignore case and color
Names and networks will now match regardless of case and color
Increases portal name/network limit to 13 characters
This commit is contained in:
2021-11-12 15:33:15 +01:00
parent 42e02eb141
commit 2c53b7d2a6
10 changed files with 87 additions and 40 deletions

View File

@ -22,7 +22,7 @@ import java.util.UUID;
public final class UUIDMigrationHelper {
private UUIDMigrationHelper() {
}
private static Map<String, List<Portal>> playerNamesToMigrate;
@ -68,7 +68,7 @@ public final class UUIDMigrationHelper {
//Get the real portal from the copy and set UUID
for (Portal portalCopy : portals) {
Portal portal = PortalHandler.getByName(portalCopy.getName(), portalCopy.getNetwork());
Portal portal = PortalHandler.getByName(portalCopy.getCleanName(), portalCopy.getCleanNetwork());
if (portal != null) {
portal.getOwner().setUUID(uniqueId);
worldsToSave.add(portal.getWorld());