Skip to content

Commit

Permalink
Fixed player status placeholder not working
Browse files Browse the repository at this point in the history
  • Loading branch information
ajgeiss0702 committed Oct 21, 2023
1 parent 41a464b commit ecd1ca3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Expand Up @@ -17,7 +17,7 @@ public ComResponse handleMessage(AdaptedPlayer player, String data) {
if(server == null) {
return ComResponse
.from("playerstatus")
.id(data)
.id(player.getUniqueId() + data)
.with("invalid_server");
}
if(!player.isConnected() || player.getServerName() == null) return null;
Expand Down
Expand Up @@ -142,10 +142,11 @@ public Future<String> getServerStatusString(String queueName, UUID player) {
if(p == null) throw new IllegalArgumentException("Player must be online!");

String channel = player == null ? "status" : "playerstatus";
String id = player == null ? queueName : player + queueName;

CompletableFuture<String> future = new CompletableFuture<>();

responseManager.awaitResponse(queueName, channel, response -> {
responseManager.awaitResponse(id, channel, response -> {
String responseString = response.getResponse();
if(responseString.equals("invalid_server")) {
future.completeExceptionally(new IllegalArgumentException(queueName + " does not exist!"));
Expand Down
Expand Up @@ -29,8 +29,8 @@ public PlaceholderExpansion(SpigotMain plugin) {
placeholders.add(new PositionOf(plugin));
placeholders.add(new Queued(plugin));
placeholders.add(new QueuedFor(plugin));
placeholders.add(new Status(plugin));
placeholders.add(new StatusPlayer(plugin));
placeholders.add(new Status(plugin));

}

Expand Down

0 comments on commit ecd1ca3

Please sign in to comment.