[SPIGOT-4007] Add DyeColor.LIGHT_GRAY Created: 15/Jul/18  Updated: 22/Jul/18  Resolved: 22/Jul/18

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor
Reporter: Cool_boy Assignee: md_5
Resolution: Fixed Votes: 2
Labels: Material, serialization

Version: 1.13-pre7

 Description   

With release 1.13, Bukkit/Spigot changes many things, to be in accordance with Minecraft version, so, I think that it's best time to deprecate/remove DyeColor.SILVER and finally implement DyeColor.LIGHT_GRAY.



 Comments   
Comment by md_5 [ 22/Jul/18 ]

Will be fixed in pending 1.13 release.

Comment by blablubbabc [ 16/Jul/18 ]

One would also have to replace all invocations of DyeColor.valueOf(String), since a plugin might previously used the name and Enum#valueOf for de/serialization purposes and Enum#valueOf cannot be overridden.

Comment by Cool_boy [ 16/Jul/18 ]

Also, now we have that bytecode transformation for plugins that were written for older version, so it's possible to just replace enum name on load for them.

Comment by Cool_boy [ 16/Jul/18 ]

Then, I suggest adding a method something like a getBlockColor(). I'm currently using this code below to get colored blocks (glass is just for an example) and DyeColor.SILVER is the only thing that does not match colors in the game.
If there already exists an API for this, then this new feature is not needed (but anyway, it would be nice).

public static Material getGlassByColor(DyeColor color) {
    return Material.getMaterial((color.equals(DyeColor.SILVER) ? "LIGHT_GRAY" : color.toString()) + "_STAINED_GLASS");
}
Comment by md_5 [ 16/Jul/18 ]

I thought more DyeColors were renamed than just this one (probably because the tropical fish in the mcwiki have different colour names).

Just the one probably makes the change slightly more approachable, it looks like the only thing that needs updating is banner patterns.

Comment by md_5 [ 15/Jul/18 ]

It's a big breaking change.

It'd need full compatibility for the enum values, ordinals, and fields, as well as serialized data.
I mean if you want to implement and test all that, sure; but seems like a lot of work for SILVER vs LIGHT_GRAY

Generated at Sat Dec 13 15:25:17 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.