Skip to content
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

Grow in handlers #4419

Merged
merged 1 commit into from Oct 28, 2019
Merged

Grow in handlers #4419

merged 1 commit into from Oct 28, 2019

Conversation

madmaxoft
Copy link
Member

@madmaxoft madmaxoft commented Oct 13, 2019

Moved block growing from cWorld / cChunk into the specific cBlockHandler descendants and cItemHandlerDye for bonemeal-related actions.

Note that this PR includes the changes from #4417, I will rebase this once that PR is merged. (rebased)

Also note that this PR removes the possibility to configure per-block bonemeal-ability. It is expected to return after 1.13 changes.

Fixes #4407.

@madmaxoft madmaxoft marked this pull request as ready for review October 16, 2019 07:59
a_Chunk.UnboundedRelFastSetBlock(pos, E_BLOCK_CACTUS, 0);

// Check surroundings. Cacti may ONLY be surrounded by non-solid blocks; if they aren't, drop as pickup and bail out the growing
static const Vector3i neighborOffsets[] =
Copy link
Member

Choose a reason for hiding this comment

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

The cactus popping off seems perfect for a OnUpdate. Does the current code still work when I place a block next to the cactus?

Copy link
Member Author

Choose a reason for hiding this comment

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

Should still work, thanks to CanBeAt (can't try right now). But it's true that the checking code should be reused, rather than having a copy here. Will fix.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can't fix easily, CanBeAt takes too different a set of parameters; changing CanBeAt to accept a single cChunk and Vector3i makes too many unrelated changes in other handlers, I'd prefer not to go that deep within this PR - especially when the block handlers will most likely be dropped entirely for the 1.13 change and then re-written from scratch.

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.

Move growing crops from Chunk to BlockHandlers
2 participants