Skip to content
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 ItemStack also implement HoverEventSource #2414

Merged
merged 1 commit into from
Mar 2, 2022

Conversation

zml2008
Copy link
Member

@zml2008 zml2008 commented Feb 12, 2022

API | Impl

This matches ItemStackSnapshot

@zml2008 zml2008 added system: text api: 8 (u) version: 1.16 (unsupported since Oct 17th 2023) labels Feb 12, 2022
Copy link
Member

@gabizou gabizou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -57,7 +59,7 @@
* use {@link ValueContainer#get(Key)} in order to retrieve information regarding
* this item stack.</p>
*/
public interface ItemStack extends SerializableDataHolder.Mutable, ComponentLike {
public interface ItemStack extends SerializableDataHolder.Mutable, ComponentLike, HoverEventSource<HoverEvent.ShowItem> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I'm expecting people to be implementing an ItemStack, but is there a way to default implement the method itself being added?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in any complete manner -- the hover event includes SNBT-serialized data from the stack's tag, which we don't reeealy expose in API

@zml2008 zml2008 self-assigned this Mar 2, 2022
@zml2008 zml2008 merged commit 70389cd into api-8 Mar 2, 2022
@zml2008 zml2008 deleted the feature/hoverable-itemstack branch March 2, 2022 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: 8 (u) version: 1.16 (unsupported since Oct 17th 2023) system: text
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants