-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Release bed POI if villager child spawn is blocked #1793
base: 1.21.x
Are you sure you want to change the base?
Release bed POI if villager child spawn is blocked #1793
Conversation
Last commit published: 01a2a084f1582bb2a8d44bb01ad2b7401903112f. PR PublishingThe artifacts published by this PR:
Repository DeclarationIn order to use the artifacts published by the PR, add the following repository to your buildscript: repositories {
maven {
name 'Maven for PR #1793' // https://github.com/neoforged/NeoForge/pull/1793
url 'https://prmaven.neoforged.net/NeoForge/pr1793'
content {
includeModule('net.neoforged', 'neoforge')
includeModule('net.neoforged', 'testframework')
}
}
} MDK installationIn order to setup a MDK using the latest PR version, run the following commands in a terminal. mkdir NeoForge-pr1793
cd NeoForge-pr1793
curl -L https://prmaven.neoforged.net/NeoForge/pr1793/net/neoforged/neoforge/21.4.40-beta-pr-1793-fix-1.21.4-GH-1606-villager-breed-finalizespawn-cancel/mdk-pr1793.zip -o mdk.zip
jar xf mdk.zip
rm mdk.zip || del mdk.zip To test a production environment, you can download the installer from here. |
Can this be tested somehow @sciwhiz12 ? |
After step 8, with this fix, the villagers' breeding attempt should be successful, and a baby villager should be spawned. Without this fix, the breeding attempt will fail, as signified by anger particles. |
What I mean is, can we create a nice test case for this in our tests so that it is automatically covered? |
This PR fixes #1606 by ensuring the bed POI is released if the villager child is blocked from spawning in the world, such as being spawn-cancelled through
FinalizeSpawnEvent
, by returning an empty optional fromVillagerMakeLove#breed
to mimic an unsuccessful breeding event. See the linked issue for more details.Tested by following the instructions in the linked issue, with the following code inserted in the constructor of
FinalizeSpawnEvent
to mimic the mod (and using hotswap to change thetrue
tofalse
as the arbitrary condition specified in the reproduction steps):