-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Add Keys.MAX_GROWTH_STAGE #4009
Conversation
Saplings should still implement the |
Makes sense, done |
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.
This wasn't actually working because the supports condition is wrong. Otherwise LGTM. Nice simplification too :)
.constructValue((h, v) -> BoundedUtil.constructImmutableValueInteger(v, Keys.GROWTH_STAGE, propertyFunction.apply(h))) | ||
.get(h -> h.getValue(propertyFunction.apply(h))) | ||
.set((h, v) -> BoundedUtil.setInteger(h, v, propertyFunction.apply(h))) | ||
.supports(cropClass::isInstance) |
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.
.supports(cropClass::isInstance) | |
.supports(h -> cropClass.isInstance(h.getBlock())) |
.supports(cropClass::isInstance) | ||
.create(Keys.MAX_GROWTH_STAGE) | ||
.get(h -> DataUtil.maxi(propertyFunction.apply(h))) | ||
.supports(cropClass::isInstance); |
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.
.supports(cropClass::isInstance); | |
.supports(h -> cropClass.isInstance(h.getBlock())); |
Oh I think I did wrong thing by making new commit instead of using "commit suggestion" button and now I can't press it. |
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.
No worries, doesn't really matter which way you do it. Thank you :)
I removed Keys.GROWTH_STAGE from saplings because it used
STAGE
property instead ofAGE
properties.And those 2 has to be differed because there is
BambooStalkBlock
that use bothSTAGE
andAGE
properties.So I think it would be better to keep only age-related blocks in this key.