Update correct encoding for GameType reading

This commit is contained in:
Camotoy 2022-12-17 23:09:20 -05:00
parent 67df108f28
commit 9bc7fd8930
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F

View file

@ -12,7 +12,9 @@ public enum GameMode implements GameEventValue {
private static final GameMode[] VALUES = values();
public static GameMode byId(int id) {
return VALUES[id];
// Yes, the way this is read is intentional. Don't remove it. As of 1.19.3.
// If the BY_ID field still exists in the vanilla sources, don't remove this.
return id >= 0 && id < VALUES.length ? VALUES[id] : VALUES[0];
}
@Nullable