diff options
author | md_5 <git@md-5.net> | 2018-09-11 20:44:34 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2018-09-11 20:45:06 +1000 |
commit | 8166d17b3d77a51b2113b280afa0790c4a27e917 (patch) | |
tree | 1c5309c14c8d084951e0c9d24ee02202893dbcf1 | |
parent | 2b93d839ddb1541cad937e3dd7a4da5d1525af3d (diff) | |
download | craftbukkit-8166d17b3d77a51b2113b280afa0790c4a27e917.tar craftbukkit-8166d17b3d77a51b2113b280afa0790c4a27e917.tar.gz craftbukkit-8166d17b3d77a51b2113b280afa0790c4a27e917.tar.lz craftbukkit-8166d17b3d77a51b2113b280afa0790c4a27e917.tar.xz craftbukkit-8166d17b3d77a51b2113b280afa0790c4a27e917.zip |
SPIGOT-4363: Bad colours in leather armor
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java index 5478e9bc..f321d854 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java @@ -36,7 +36,11 @@ class CraftMetaLeatherArmor extends CraftMetaItem implements LeatherArmorMeta { if (tag.hasKey(DISPLAY.NBT)) { NBTTagCompound display = tag.getCompound(DISPLAY.NBT); if (display.hasKey(COLOR.NBT)) { - color = Color.fromRGB(display.getInt(COLOR.NBT)); + try { + color = Color.fromRGB(display.getInt(COLOR.NBT)); + } catch (IllegalArgumentException ex) { + // Invalid colour + } } } } |