remove useless enum::getId to Enum::ordinal aliases

This commit is contained in:
Bixilon 2020-10-21 20:23:04 +02:00
parent 46d4a0ab06
commit d1b6a581f7
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
8 changed files with 2 additions and 26 deletions

View File

@ -21,8 +21,4 @@ public enum ChatTextPositions {
public static ChatTextPositions byId(int id) {
return values()[id];
}
public int getId() {
return ordinal();
}
}

View File

@ -22,8 +22,4 @@ public enum Difficulties {
public static Difficulties byId(int id) {
return values()[id];
}
public int getId() {
return ordinal();
}
}

View File

@ -24,8 +24,4 @@ public enum Directions {
public static Directions byId(int id) {
return values()[id];
}
public int getId() {
return ordinal();
}
}

View File

@ -28,8 +28,4 @@ public enum SoundCategories {
public static SoundCategories byId(int id) {
return values()[id];
}
public int getId() {
return ordinal();
}
}

View File

@ -25,8 +25,4 @@ public enum Poses {
public static Poses byId(int id) {
return values()[id];
}
public int getId() {
return ordinal();
}
}

View File

@ -45,7 +45,7 @@ public class PacketHandshake implements ServerboundPacket {
buffer.writeVarInt((nextState == ConnectionStates.STATUS ? -1 : connection.getVersion().getProtocolVersion())); // get best protocol version
buffer.writeString(address.getHostname());
buffer.writeShort((short) address.getPort());
buffer.writeVarInt(nextState.getId());
buffer.writeVarInt(nextState.ordinal());
return buffer;
}

View File

@ -47,7 +47,7 @@ public class PacketClientSettings implements ServerboundPacket {
buffer.writeByte((byte) 0x00); // chat settings (nobody uses them)
buffer.writeBoolean(true); // chat colors
if (buffer.getProtocolId() < 6) {
buffer.writeByte((byte) Difficulties.NORMAL.getId()); // difficulty
buffer.writeByte((byte) Difficulties.NORMAL.ordinal()); // difficulty
buffer.writeBoolean(true); // cape
} else {
buffer.writeByte((byte) 0b01111111); // ToDo: skin parts

View File

@ -27,8 +27,4 @@ public enum ConnectionStates {
public static ConnectionStates byId(int id) {
return values()[id];
}
public int getId() {
return ordinal();
}
}