fix ic2 crops making any farmland trampleable #425
Merged
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.
Each IC2 plant can implement a
onEntityCollision
behavior for when it should be trampled.By default, crops can be trampled by sprinting over it.
When an IC2 crop is trampled this way, it will set the block below it to dirt.
This is an issue, because it means that even farmland which shouldn't be tramplable (at least via the vanilla falling-onto-farmland mechanic) like Fertilized Dirt can be trampled and will be replaced with normal dirt (instead of the un-tilled fertilized dirt).
This fix just disables the ic2 crop trampling by sprinting for blocks that aren't normal farmland.
If there are any custom farmlands that should be able to be trampled, they can just be specially cased in the fix, but I'm not aware of any.
Could also be implemented by calling
onFallenUpon
when attempting to trample the crop to try to invoke its trampling-by-falling-onto behavior and avoid any special-casing, but not sure if that's a good idea; who knows what devs are using that method.After running over some crops containing plants that can be trampled:
Fixes GTNewHorizons/GT-New-Horizons-Modpack#4571 and thus needs a quest update to this quest
( GTNewHorizons/GT-New-Horizons-Modpack#16658 )