mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-15 05:41:51 +08:00
Don't replace placeholder if given player identifier is not found
This commit is contained in:
parent
3119f35cb6
commit
8ee494f6e4
@ -121,11 +121,14 @@ public final class PlanPlaceholders {
|
||||
return Objects.toString(staticLoader.apply(arguments));
|
||||
}
|
||||
|
||||
UUID playerUUID = arguments.get(0)
|
||||
.flatMap(this::getPlayerUUIDForIdentifier)
|
||||
.orElse(uuid);
|
||||
Optional<String> givenIdentifier = arguments.get(0);
|
||||
Optional<UUID> foundUUID = givenIdentifier
|
||||
.flatMap(this::getPlayerUUIDForIdentifier);
|
||||
UUID playerUUID = foundUUID.orElse(uuid);
|
||||
PlayerContainer player;
|
||||
if (playerUUID != null) {
|
||||
if (givenIdentifier.isPresent() && !foundUUID.isPresent()) {
|
||||
player = null; // Don't show other player whose identifier is not found.
|
||||
} else if (playerUUID != null) {
|
||||
player = dbSystem.getDatabase().query(ContainerFetchQueries.fetchPlayerContainer(playerUUID));
|
||||
} else {
|
||||
player = null;
|
||||
|
Loading…
Reference in New Issue
Block a user