Merge pull request #2597 from Multiverse/cleanup

Cleanup
This commit is contained in:
nicegamer7 2021-03-18 10:52:28 -04:00 committed by GitHub
commit a2c5bf70f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View File

@ -27,7 +27,9 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.regex.Pattern; import java.util.regex.Pattern;
/** A factory class that will create destinations from specific strings. */ /**
* A factory class that will create destinations from specific strings.
*/
public class DestinationFactory { public class DestinationFactory {
private static final Pattern CANNON_PATTERN = Pattern.compile("(?i)cannon-[\\d]+(\\.[\\d]+)?"); private static final Pattern CANNON_PATTERN = Pattern.compile("(?i)cannon-[\\d]+(\\.[\\d]+)?");
@ -166,6 +168,11 @@ public class DestinationFactory {
return true; return true;
} }
/**
* Gets all the {@link MVDestination} identifiers registered.
*
* @return A collection of destination identifiers.
*/
public Collection<String> getRegisteredIdentifiers() { public Collection<String> getRegisteredIdentifiers() {
return this.destList.keySet(); return this.destList.keySet();
} }

View File

@ -135,7 +135,7 @@ public class PlayerFinder {
List<Player> matchedPlayers = getMultiBySelector(playerSelector, sender); List<Player> matchedPlayers = getMultiBySelector(playerSelector, sender);
if (matchedPlayers == null || matchedPlayers.isEmpty()) { if (matchedPlayers == null || matchedPlayers.isEmpty()) {
Logging.warning("No player found with selector '%s' for %s.", playerSelector, sender.getName()); Logging.fine("No player found with selector '%s' for %s.", playerSelector, sender.getName());
return null; return null;
} }
if (matchedPlayers.size() > 1) { if (matchedPlayers.size() > 1) {

View File

@ -55,7 +55,6 @@ import java.util.stream.Collectors;
*/ */
public class WorldManager implements MVWorldManager { public class WorldManager implements MVWorldManager {
private final MultiverseCore plugin; private final MultiverseCore plugin;
private final Pattern worldNamePattern = Pattern.compile("[a-zA-Z0-9/._-]+");
private final WorldPurger worldPurger; private final WorldPurger worldPurger;
private final Map<String, MultiverseWorld> worlds; private final Map<String, MultiverseWorld> worlds;
private Map<String, WorldProperties> worldsFromTheConfig; private Map<String, WorldProperties> worldsFromTheConfig;