Uses matcher.find instead of matcher.matches

Also removes some code smells
This commit is contained in:
2024-02-20 19:45:41 +01:00
parent 9abf6db27a
commit cde20e35d5
4 changed files with 42 additions and 20 deletions

View File

@@ -59,14 +59,14 @@ public final class PortalFileHelper {
if (portal.getWorld() == null) {
Stargate.logSevere(String.format("Could not save portal %s because its world is null",
portal.getName()));
continue;
} else {
String worldName = portal.getWorld().getName();
if (!worldName.equalsIgnoreCase(world.getName())) {
continue;
}
//Save the portal
savePortal(bufferedWriter, portal);
}
String worldName = portal.getWorld().getName();
if (!worldName.equalsIgnoreCase(world.getName())) {
continue;
}
//Save the portal
savePortal(bufferedWriter, portal);
}
bufferedWriter.close();