Fix #9381: deployer breaks all turtle eggs at once instead of one by one#10101
Open
TiagoCachadinha wants to merge 1 commit intoCreators-of-Create:mc1.21.1/devfrom
Open
Fix #9381: deployer breaks all turtle eggs at once instead of one by one#10101TiagoCachadinha wants to merge 1 commit intoCreators-of-Create:mc1.21.1/devfrom
TiagoCachadinha wants to merge 1 commit intoCreators-of-Create:mc1.21.1/devfrom
Conversation
…instead of one by one The deployer's tryHarvestBlock method removes a block in a way that bypasses playerDestroy, which is called when a player destroys a block normally. TurtleEggBlock overrides this method so that after it is destroyed, it places it back with EGGS decremented. Since tryHarvestBlock never calls playerDestroy, this logic is skipped and the whole cluster is destroyed at once. The fix special-cases TurtleEggBlock to decrement EGGS manually and handle drops if the cluster has more than one egg. A game test was added where a deployer with a silk touch tool and one without break different 4 turtle egg clusters. The one without silk touch must break them one by one, without harvesting any. The one with silk touch must break and harvest them one by one into its hopper.
Author
|
Hey @VoidLeech, just letting you know I updated the PR description with a video showing the bug is fixed and the test i created, so that it is easier to review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9381
The deployer's tryHarvestBlock method removes a block in a way that bypasses playerDestroy, which is called when a player destroys a block normally. TurtleEggBlock overrides this method so that after it is destroyed, it places it back with EGGS decremented. Since tryHarvestBlock never calls playerDestroy, this logic is skipped and the whole cluster is destroyed at once.
The fix special-cases TurtleEggBlock to decrement EGGS manually and handle drops if the cluster has more than one egg.
DeployerTurtleEggsIssueSolved_compressed.mp4
A game test was added where a deployer with a silk touch tool and one without break different 4 turtle egg clusters. The one without silk touch must break them one by one, without harvesting any. The one with silk touch must break and harvest them one by one into its hopper.