Optimized flower color enumeration array retrieval (#40)

This commit is contained in:
Pelotrio authored and GitHub committed 2023-11-15 00:19:42 +00:00
1 parent 00c214ee5d
commit a609f5dce5
1 file changed
+2 -1
@@ -92,6 +92,7 @@ public enum EnumFlowerColor implements IFlowerColor {
YELLOW("yellow", 0xffff00),
YELLOW_GREEN("yellowGreen", 0x9acd32);
private static final EnumFlowerColor[] ALL_VALUES = values();
private int color;
private int colorDis;
private String name;
@@ -2963,7 +2964,7 @@ public enum EnumFlowerColor implements IFlowerColor {
}
public static EnumFlowerColor get(int i) {
return values()[Math.max(0, i) % values().length];
return ALL_VALUES[Math.max(0, i) % ALL_VALUES.length];
}
@Override