-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make spawn egg colours visible #10158
Conversation
Please squash commits in each submodule and rebuildPatches. |
Whoops, didn't notice it made a new patch, fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be nice to add getters for the background & highlight color to spawn egg meta, but currently also lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this wasn't in Unsafe, I would have some comments, but I think since it is, and therefore API compat isn't guaranteed, I think its fine.
Perhaps some more stable API can be added once we have subtypes of ItemType and BlockType in the API.
Co-authored-by: Yannick Lamprecht <[email protected]>
Co-authored-by: Yannick Lamprecht <[email protected]>
b5271a0
to
e2efd1e
Compare
Co-authored-by: Yannick Lamprecht <[email protected]>
Adds an unsafe method for getting the underlying colour definitions for spawn eggs, based on the entity type. I recognise this is probably a fairly niche thing, but it can be useful to have a consistent way of getting some colours for entities when doing certain visual effects.
I've added this to UnsafeValues as it's accessing data directly from the SpawnEggItem class rather than reading data from an individual ItemStack's meta, although I'm happy for it to be moved somewhere more appropriate if desired.
The code is based on ItemFactory#getSpawnEgg, as found in this patch.