Build AsminVoicechat / prepare-release (push) Successful in 14s
Build AsminVoicechat / build-and-test (17) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (18) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (19) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (20) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (21) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (22) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (23) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (24) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (25) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (26) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (27-ea) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (16) (push) Canceled after 38s
65 lines
2.1 KiB
Java
65 lines
2.1 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javax.annotation.Nullable
|
|
* me.clip.placeholderapi.expansion.PlaceholderExpansion
|
|
* org.bukkit.entity.Player
|
|
*/
|
|
package de.maxhenkel.voicechat.integration.placeholderapi;
|
|
|
|
import de.maxhenkel.voicechat.Voicechat;
|
|
import de.maxhenkel.voicechat.voice.common.PlayerState;
|
|
import de.maxhenkel.voicechat.voice.server.Server;
|
|
import javax.annotation.Nullable;
|
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
|
import org.bukkit.entity.Player;
|
|
|
|
public class VoicechatExpansion
|
|
extends PlaceholderExpansion {
|
|
public String getIdentifier() {
|
|
return "voicechat";
|
|
}
|
|
|
|
public String getAuthor() {
|
|
return String.join((CharSequence)", ", Voicechat.INSTANCE.getDescription().getAuthors());
|
|
}
|
|
|
|
public String getVersion() {
|
|
return Voicechat.INSTANCE.getDescription().getVersion();
|
|
}
|
|
|
|
public boolean persist() {
|
|
return true;
|
|
}
|
|
|
|
@Nullable
|
|
public String onPlaceholderRequest(Player player, String params) {
|
|
if (player == null) {
|
|
return super.onPlaceholderRequest(player, params);
|
|
}
|
|
if (params.equalsIgnoreCase("installed")) {
|
|
return Voicechat.SERVER.isCompatible(player) ? Voicechat.TRANSLATIONS.placeholderVoicechatInstalled.get() : "";
|
|
}
|
|
if (params.equalsIgnoreCase("not_installed")) {
|
|
return !Voicechat.SERVER.isCompatible(player) ? Voicechat.TRANSLATIONS.placeholderVoicechatNotInstalled.get() : "";
|
|
}
|
|
if (params.equalsIgnoreCase("disabled")) {
|
|
Server server = Voicechat.SERVER.getServer();
|
|
if (server == null) {
|
|
return "";
|
|
}
|
|
PlayerState state = server.getPlayerStateManager().getState(player.getUniqueId());
|
|
if (state == null) {
|
|
return "";
|
|
}
|
|
if (!state.isDisabled()) {
|
|
return "";
|
|
}
|
|
return Voicechat.TRANSLATIONS.placeholderVoicechatDisabled.get();
|
|
}
|
|
return super.onPlaceholderRequest(player, params);
|
|
}
|
|
}
|
|
|