mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-02-13 11:01:55 +01:00
Add invalid value to color-format exception
This commit is contained in:
parent
ec2d316b63
commit
cc99021ca8
@ -1 +1 @@
|
||||
Subproject commit c70ab29ae87cd79a3553bef4aca7fa94db577293
|
||||
Subproject commit f9bbdc3d38405f59a82f427b868d6d5f7545738e
|
@ -176,7 +176,7 @@ public Color parse(String val) {
|
||||
if (val.length() == 3) val = val + "f";
|
||||
if (val.length() == 4) val = "" + val.charAt(0) + val.charAt(0) + val.charAt(1) + val.charAt(1) + val.charAt(2) + val.charAt(2) + val.charAt(3) + val.charAt(3);
|
||||
if (val.length() == 6) val = val + "ff";
|
||||
if (val.length() != 8) throw new NumberFormatException("Invalid color format!");
|
||||
if (val.length() != 8) throw new NumberFormatException("Invalid color format: '" + val + "'!");
|
||||
val = val.substring(6, 8) + val.substring(0, 6); // move alpha to front
|
||||
return set(Integer.parseUnsignedInt(val, 16));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user