-
-
Notifications
You must be signed in to change notification settings - Fork 110
MaterialTag.count bug fix, additions, and modernization #2784
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
base: dev
Are you sure you want to change the base?
Conversation
tal5
left a comment
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.
Can also replace some of the isX/getX methods with instanceof pattern matching if you want to modernize a bit more, but not required for now.
| } | ||
| else if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_19) && material.getModernData() instanceof PinkPetals) { | ||
| else if ((NMSHandler.getVersion().isAtLeast(NMSVersion.v1_19) && getBlockData() instanceof PinkPetals) | ||
| || (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_21) && (getBlockData() instanceof FlowerBed) || getBlockData() instanceof LeafLitter) |
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.
The brackets around the FlowerBed check need to cover both FlowerBed and LeafLitter - it's version >= 1.21 && (flower bed || leaf litter)
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.
Don't think this was fixed?
| // TODO The PinkPetals interface was deprecated in 1.21.5 and merged into the FlowerBed interface. | ||
| // All references and checks involving them can be removed once 1.21 is the minimum supported version. |
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.
Just so that it's easier to find later on, we usually format these like // TODO once 1.21 is the minimum supported version, remove PinkPetals usage in favor of FlowerBed or something along these lines, can see other TODOs around the project for example.
| } | ||
| else if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_19) && material.getModernData() instanceof PinkPetals) { | ||
| else if ((NMSHandler.getVersion().isAtLeast(NMSVersion.v1_19) && getBlockData() instanceof PinkPetals) | ||
| || (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_21) && (getBlockData() instanceof FlowerBed) || getBlockData() instanceof LeafLitter) |
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.
Don't think this was fixed?
| // @name count | ||
| // @input ElementTag(Number) | ||
| // @description | ||
| // Controls the amount of pickles in a Sea Pickle material, eggs in a Turtle Egg material, charges in a Respawn Anchor material, candles in a Candle material, flowers in a flower bed, or leaves on the ground. |
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.
leaves on the ground is a bit vague, specify that this is about leaf litter like the other options do.
|
fixed |
Mentioned in https://discord.com/channels/315163488085475337/1430419152589553736