/* * Decompiled with CFR 0.152. * * Could not load the following classes: * javax.annotation.Nullable * org.bukkit.entity.Player */ package de.maxhenkel.voicechat.plugins.impl.events; import de.maxhenkel.voicechat.Voicechat; import de.maxhenkel.voicechat.api.VoicechatConnection; import de.maxhenkel.voicechat.api.events.PlayerStateChangedEvent; import de.maxhenkel.voicechat.plugins.impl.VoicechatConnectionImpl; import de.maxhenkel.voicechat.plugins.impl.events.ServerEventImpl; import de.maxhenkel.voicechat.voice.common.PlayerState; import java.util.UUID; import javax.annotation.Nullable; import org.bukkit.entity.Player; public class PlayerStateChangedEventImpl extends ServerEventImpl implements PlayerStateChangedEvent { protected final PlayerState state; @Nullable protected VoicechatConnectionImpl connection; public PlayerStateChangedEventImpl(PlayerState state) { this.state = state; } @Override public boolean isDisabled() { return this.state.isDisabled(); } @Override public boolean isDisconnected() { return this.state.isDisconnected(); } @Override public UUID getPlayerUuid() { return this.state.getUuid(); } @Override @Nullable public VoicechatConnection getConnection() { if (this.connection == null) { Player player = Voicechat.INSTANCE.getServer().getPlayer(this.state.getUuid()); if (player == null) { return null; } this.connection = VoicechatConnectionImpl.fromPlayer(player); } return this.connection; } }