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

Finalize spawn targets are not being updated #1168

Open
Shadows-of-Fire opened this issue Jun 22, 2024 · 0 comments
Open

Finalize spawn targets are not being updated #1168

Shadows-of-Fire opened this issue Jun 22, 2024 · 0 comments
Labels
1.21 Targeted at Minecraft 1.21 bug A bug or error regression Worked previously but doesn't anymore

Comments

@Shadows-of-Fire
Copy link
Contributor

Since the change to NG, the findFinalizeSpawnTargets task was removed

NeoForge/build.gradle

Lines 873 to 883 in a3317fc

task findFinalizeSpawnTargets(type: BytecodePredicateFinder, dependsOn: ['createJoinedSRG']) {
jar = createJoinedSRG.output
output = rootProject.file('src/main/resources/coremods/finalize_spawn_targets.json')
predicate = {
parent, node, insn ->
'net/minecraft/world/level/BaseSpawner' != parent.name // Ignore this class as we special case it.
&& insn.getOpcode() == Opcodes.INVOKEVIRTUAL
&& insn.name.equals('m_6518_')
&& insn.desc.equals('(Lnet/minecraft/world/level/ServerLevelAccessor;Lnet/minecraft/world/DifficultyInstance;Lnet/minecraft/world/entity/MobSpawnType;Lnet/minecraft/world/entity/SpawnGroupData;Lnet/minecraft/nbt/CompoundTag;)Lnet/minecraft/world/entity/SpawnGroupData;')
}
}

This task is needed to ensure that our FinalizeSpawnEvent is fired appropriately for all vanilla cases. To re-implement this, we need something akin to BytecodePredicateFinder from FG that allows the vanilla classes to be scanned for target instructions.

@Shadows-of-Fire Shadows-of-Fire added bug A bug or error regression Worked previously but doesn't anymore 1.21 Targeted at Minecraft 1.21 labels Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21 Targeted at Minecraft 1.21 bug A bug or error regression Worked previously but doesn't anymore
Projects
None yet
Development

No branches or pull requests

1 participant