/* * 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); } }