Skip to content

Keep vanilla check for custom growth modifier for sugar cane and cactus#8555

Closed
Lulu13022002 wants to merge 1 commit into
PaperMC:masterfrom
Lulu13022002:fix/spigotgrowth2
Closed

Keep vanilla check for custom growth modifier for sugar cane and cactus#8555
Lulu13022002 wants to merge 1 commit into
PaperMC:masterfrom
Lulu13022002:fix/spigotgrowth2

Conversation

@Lulu13022002
Copy link
Copy Markdown
Contributor

@Lulu13022002 Lulu13022002 commented Nov 11, 2022

Closes #8544

The spigot growth modifier is broken for both sugar cane and cactus and the mentionned issue also happens for
sugar cane but it's more complex to reproduce (basically destroy the water source once placed and observe (vanilla will break the plant but not spigot one)
The old bahavior can possibly run two roll that also break the percent modifier

The new system handle correctly the percent in four stage
When modifier = 100: keep vanilla behavior
When modifier < 100: gives less chance to the plant to increase its own age
When modifer > 100 but < 1600: increase the age by more than one depending on the percent
When modifier >= 1600: fast grow, the age will not increase but they can grow directly even for an age smaller than 15
but to keep this consistent with vanilla we need to include the grow check in the same tick and not one tick after like usually

@Lulu13022002 Lulu13022002 requested a review from a team as a code owner November 11, 2022 12:53
Copy link
Copy Markdown
Contributor

@lynxplay lynxplay left a comment

Choose a reason for hiding this comment

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

I honestly think the entire concept of directly growing a cactus that is not age 15 is rather flawed.
I have a patch in the works for this, I'll open a PR for it this weekend so if you are fine with it I might supersede your PR.

See: e65b7ab

@Lulu13022002
Copy link
Copy Markdown
Contributor Author

Yes, you're right but even growing the cactus from more than one is strange because then it will ignore some stage that will never be used, but then we can't support the greater modifier

@lynxplay
Copy link
Copy Markdown
Contributor

Yea, I mean if we had to actually get through every stage, we'd had to reschedule random ticks ?
But that tbh is a worth while thing to allow for the modifiers.
I'd be very happy if you could chime in on the PR I'll open this weekend.

Especially in regards to the then unused stages. We could look into a gaussian distribution for the age growth instead of what my patch suggests rn to cover all ages.

@Lulu13022002 Lulu13022002 deleted the fix/spigotgrowth2 branch July 7, 2024 10:15
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.

Modifying cactus growth modifier causes it to not break after growing

2 participants