Return COLOR_0 for null values in MapColor

Might be better to eventually figure out why this is null to begin with, but for the time being considering maps are not working, we'd have to get to that step first. This just prevents the console from spamming errors, and will do until maps are fully implemented/fixed.
This commit is contained in:
RednedEpic 2020-04-14 23:35:59 -05:00
parent b15d37a4c5
commit dbe2a9b3b0

View file

@ -227,7 +227,7 @@ public enum MapColor {
} }
public static MapColor fromId(int id) { public static MapColor fromId(int id) {
return Arrays.stream(values()).filter(color -> color.getId() == id).findFirst().get(); return Arrays.stream(values()).filter(color -> color.getId() == id).findFirst().orElse(COLOR_0);
} }
public int toARGB() { public int toARGB() {