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

Add task to generate finalizeSpawn MethodRedirector coremod targets #1756

Merged
merged 4 commits into from
Dec 12, 2024

Conversation

Technici4n
Copy link
Member

@Technici4n Technici4n commented Dec 10, 2024

What the title says. The only new target that is found by the new task is net/minecraft/world/level/block/entity/trialspawner/TrialSpawner, which needs special casing and must therefore be ignored. So the only change to the targets for now are just indentation changes due to differing defaults between Groovy's standard library and GSON.

Fixes #1168.

@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Dec 10, 2024

  • Publish PR to GitHub Packages

Last commit published: 4a3661df00cb83c1b27324a18bf2296fe1a74745.

PR Publishing

The artifacts published by this PR:

Repository Declaration

In order to use the artifacts published by the PR, add the following repository to your buildscript:

repositories {
    maven {
        name 'Maven for PR #1756' // https://github.com/neoforged/NeoForge/pull/1756
        url 'https://prmaven.neoforged.net/NeoForge/pr1756'
        content {
            includeModule('net.neoforged', 'neoforge')
            includeModule('net.neoforged', 'testframework')
        }
    }
}

MDK installation

In order to setup a MDK using the latest PR version, run the following commands in a terminal.
The script works on both *nix and Windows as long as you have the JDK bin folder on the path.
The script will clone the MDK in a folder named NeoForge-pr1756.
On Powershell you will need to remove the -L flag from the curl invocation.

mkdir NeoForge-pr1756
cd NeoForge-pr1756
curl -L https://prmaven.neoforged.net/NeoForge/pr1756/net/neoforged/neoforge/21.4.21-beta-pr-1756-fix-1168/mdk-pr1756.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.

Copy link
Member

@Matyrobbrt Matyrobbrt left a comment

Choose a reason for hiding this comment

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

Honestly I'm not convinced about the use of a json file for a list of class names, it would probably be faster to use a comma separated text file but I don't really care.

@Matyrobbrt Matyrobbrt added bug A bug or error ci/build Related to continuous integration/build system 1.21.4 Targeted at Minecraft 1.21.4 labels Dec 10, 2024
@Shadows-of-Fire
Copy link
Contributor

TrialSpawner should be ignored in the same way BaseSpawner is, since we patch that one too.

- if (flag) {
- mob.finalizeSpawn(p_312582_, p_312582_.getCurrentDifficultyAt(mob.blockPosition()), EntitySpawnReason.TRIAL_SPAWNER, null);
- }
+ // Neo: Patch in FinalizeSpawn for spawners so it may be fired unconditionally, instead of only when vanilla would normally call it.
+ // The local flag is the conditions under which the spawner will normally call Mob#finalizeSpawn.
+ net.neoforged.neoforge.event.EventHooks.finalizeMobSpawnSpawner(mob, p_312582_, p_312582_.getCurrentDifficultyAt(mob.blockPosition()), EntitySpawnReason.TRIAL_SPAWNER, null, this, flag);

@neoforged-automation
Copy link

@Technici4n, this pull request has conflicts, please resolve them for this PR to move forward.

@Technici4n
Copy link
Member Author

Indeed, thanks @Shadows-of-Fire!

@Technici4n Technici4n merged commit 4d3958a into neoforged:1.21.x Dec 12, 2024
6 checks passed
@Technici4n Technici4n deleted the fix-1168 branch December 12, 2024 09:11
@neoforged-releases
Copy link

🚀 This PR has been released as NeoForge version 21.4.19-beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21.4 Targeted at Minecraft 1.21.4 bug A bug or error ci/build Related to continuous integration/build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Finalize spawn targets are not being updated
3 participants