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

re-add the "PitcherCropBlock.java" patch #934

Closed
Lolothepro opened this issue May 5, 2024 · 2 comments · Fixed by #963
Closed

re-add the "PitcherCropBlock.java" patch #934

Lolothepro opened this issue May 5, 2024 · 2 comments · Fixed by #963
Labels
1.20.6 Targeted at Minecraft 1.20.6 bug A bug or error regression Worked previously but doesn't anymore triage Needs triaging and confirmation

Comments

@Lolothepro
Copy link
Contributor

https://github.com/neoforged/NeoForge/blob/1.20.x/patches/net/minecraft/world/level/block/PitcherCropBlock.java.patch

Currently the patch is empty, and there's a TODO porting for Minecraft 1.20.2... it's a bit weird.

@Lolothepro Lolothepro added the triage Needs triaging and confirmation label May 5, 2024
@sciwhiz12
Copy link
Member

This looks to be missing the patch added in 027f4d3.

For reference, here is the patch with the SRG names converted to Mojang names:

--- a/net/minecraft/world/level/block/PitcherCropBlock.java
+++ b/net/minecraft/world/level/block/PitcherCropBlock.java
@@ -69,7 +_,11 @@
       if (!isLower(state)) {
          return super.canSurvive(state, level, pos);
       } else {
-         return this.mayPlaceOn(level.getBlockState(pos.below()), level, pos.below()) && sufficientLight(level, pos) && (state.getValue(AGE) < 3 || isUpper(level.getBlockState(pos.above())));
+         BlockPos below = pos.below();
+         boolean isSoil = this.mayPlaceOn(level.getBlockState(below), level, below);
+         if (state.getBlock() == this) //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
+            isSoil = level.getBlockState(below).canSustainPlant(level, below, Direction.UP, this);
+         return isSoil && sufficientLight(level, pos) && (state.getValue(AGE) < 3 || isUpper(level.getBlockState(pos.above())));
       }
    }
 

@sciwhiz12 sciwhiz12 added bug A bug or error regression Worked previously but doesn't anymore 1.20.6 Targeted at Minecraft 1.20.6 labels May 15, 2024
@TelepathicGrunt
Copy link
Sponsor Contributor

TelepathicGrunt commented May 16, 2024

The old patch breaks vanilla behavior as it causes pitcher plant crop to break if next to a block when age 3 or higher. Vanilla does not break.

2024-05-15.22-34-07.mp4

In fact, I can't find anything that the patch actually "fixes".

My recommendation is to just remove the TODO.

TelepathicGrunt added a commit to TelepathicGrunt/NeoForge that referenced this issue May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.20.6 Targeted at Minecraft 1.20.6 bug A bug or error regression Worked previously but doesn't anymore triage Needs triaging and confirmation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants