Skip to content

Conversation

@MC-Samuel
Copy link
Contributor

Requested in https://discord.com/channels/315163488085475337/1417889631269032079
Adds Dried Ghast hydration to the MaterialTag.level property and related tags

Copy link
Member

@tal5 tal5 left a comment

Choose a reason for hiding this comment

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

Other then this, LGTM!

// -->
PropertyParser.registerStaticTag(MaterialLevel.class, ElementTag.class, "minimum_level", (attribute, material) -> {
return new ElementTag(material.getMin());
return new ElementTag(material.getBlockData() instanceof Snow snow ? snow.getMinimumLayers() : 0);
Copy link
Member

Choose a reason for hiding this comment

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

This is simple logic, but it's still being repeated here, I'd keep it in a method as this property could definitely support more stuff in the future that have a non-0 min value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines 84 to 85
if (level < (getBlockData() instanceof Snow snow ? snow.getMinimumLayers() : 0) || level > getMax()) {
mechanism.echoError("Level value '" + level + "' is not valid. Must be between " + (getBlockData() instanceof Snow snow ? snow.getMinimumLayers() : 0) + " and " + getMax() + " for material '" + getBlockData().getMaterial().name() + "'.");
Copy link
Member

Choose a reason for hiding this comment

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

This needs to use getMin as well I believe?

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