Skip to content

Conversation

@MC-Samuel
Copy link
Contributor

Adds in the heart_state tag and mechanism to control a creaking heart's state.
Requested in https://discord.com/channels/315163488085475337/1429656035865530380

// -->
tagProcessor.registerTag(ElementTag.class, "heart_state", (attribute, object) -> {
if (!(object.getBlockState().getBlockData() instanceof CreakingHeart heart)) {
Debug.echoError("The 'LocationTag.heart_state' tag can only be called on a creaking heart block.");
Copy link
Member

Choose a reason for hiding this comment

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

Attribute#echoError

Debug.echoError("The 'LocationTag.heart_state' tag can only be called on a creaking heart block.");
return null;
}
return Utilities.enumlikeToElement(heart.getCreakingHeartState());
Copy link
Member

Choose a reason for hiding this comment

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

Can probably just be new ElementTag(state)? These methods do some extra stuff for legacy/cross-version compatibility, but aren't really needed for normal enum usage.

});

// <--[mechanism]
// @object LocationTag
Copy link
Member

Choose a reason for hiding this comment

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

This seems to be operating on just the BlockData, is there any reason it's on LocationTag and not a MaterialTag property (maybe in MaterialTag.mode)?

@MC-Samuel MC-Samuel marked this pull request as draft October 26, 2025 03:41
@MC-Samuel MC-Samuel marked this pull request as ready for review November 22, 2025 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants