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
101 lines
2.4 KiB
Java
101 lines
2.4 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javax.annotation.Nullable
|
|
*/
|
|
package de.maxhenkel.voicechat.voice.common;
|
|
|
|
import de.maxhenkel.voicechat.util.FriendlyByteBuf;
|
|
import java.util.UUID;
|
|
import javax.annotation.Nullable;
|
|
|
|
public class PlayerState {
|
|
private UUID uuid;
|
|
private String name;
|
|
private boolean disabled;
|
|
private boolean disconnected;
|
|
@Nullable
|
|
private UUID group;
|
|
|
|
public PlayerState(UUID uuid, String name, boolean disabled, boolean disconnected) {
|
|
this.uuid = uuid;
|
|
this.name = name;
|
|
this.disabled = disabled;
|
|
this.disconnected = disconnected;
|
|
}
|
|
|
|
public UUID getUuid() {
|
|
return this.uuid;
|
|
}
|
|
|
|
public void setUuid(UUID uuid) {
|
|
this.uuid = uuid;
|
|
}
|
|
|
|
public String getName() {
|
|
return this.name;
|
|
}
|
|
|
|
public void setName(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
public boolean isDisabled() {
|
|
return this.disabled;
|
|
}
|
|
|
|
public void setDisabled(boolean disabled) {
|
|
this.disabled = disabled;
|
|
}
|
|
|
|
public boolean isDisconnected() {
|
|
return this.disconnected;
|
|
}
|
|
|
|
public void setDisconnected(boolean disconnected) {
|
|
this.disconnected = disconnected;
|
|
}
|
|
|
|
@Nullable
|
|
public UUID getGroup() {
|
|
return this.group;
|
|
}
|
|
|
|
public void setGroup(@Nullable UUID group) {
|
|
this.group = group;
|
|
}
|
|
|
|
public boolean hasGroup() {
|
|
return this.group != null;
|
|
}
|
|
|
|
public String toString() {
|
|
return "{disabled=" + this.disabled + ", disconnected=" + this.disconnected + ", uuid=" + this.uuid + ", name=" + this.name + ", group=" + this.group + '}';
|
|
}
|
|
|
|
public static PlayerState fromBytes(FriendlyByteBuf buf) {
|
|
boolean disabled = buf.readBoolean();
|
|
boolean disconnected = buf.readBoolean();
|
|
UUID uuid = buf.readUUID();
|
|
String name = buf.readUtf(Short.MAX_VALUE);
|
|
PlayerState state = new PlayerState(uuid, name, disabled, disconnected);
|
|
if (buf.readBoolean()) {
|
|
state.setGroup(buf.readUUID());
|
|
}
|
|
return state;
|
|
}
|
|
|
|
public void toBytes(FriendlyByteBuf buf) {
|
|
buf.writeBoolean(this.disabled);
|
|
buf.writeBoolean(this.disconnected);
|
|
buf.writeUUID(this.uuid);
|
|
buf.writeUtf(this.name);
|
|
buf.writeBoolean(this.hasGroup());
|
|
if (this.hasGroup()) {
|
|
buf.writeUUID(this.group);
|
|
}
|
|
}
|
|
}
|
|
|