forked from Upstream/Velocitab
Use byte instead of int for packet update mode
This commit is contained in:
parent
3e4f036171
commit
fb0be16fd7
@ -129,23 +129,23 @@ public class UpdateTeamsPacket extends AbstractPacket {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enum UpdateMode {
|
public enum UpdateMode {
|
||||||
CREATE(0),
|
CREATE((byte) 0),
|
||||||
REMOVE(1),
|
REMOVE((byte) 1),
|
||||||
UPDATE_INFO(2),
|
UPDATE_INFO((byte) 2),
|
||||||
ADD_PLAYERS(3),
|
ADD_PLAYERS((byte) 3),
|
||||||
REMOVE_PLAYERS(4);
|
REMOVE_PLAYERS((byte) 4);
|
||||||
|
|
||||||
private final int id;
|
private final byte id;
|
||||||
|
|
||||||
UpdateMode(int id) {
|
UpdateMode(byte id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int id() {
|
public byte id() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static UpdateMode byId(int id) {
|
public static UpdateMode byId(byte id) {
|
||||||
return Arrays.stream(values())
|
return Arrays.stream(values())
|
||||||
.filter(mode -> mode.id == id)
|
.filter(mode -> mode.id == id)
|
||||||
.findFirst()
|
.findFirst()
|
||||||
|
Loading…
Reference in New Issue
Block a user