# `@Overwrite` of `WorldEntitySpawner.findChunksForSpawning` blocks other mods' injectors (crash with FermiumMixins)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start by inspecting MixinWorldEntitySpawner and its @Overwrite of WorldEntitySpawner.findChunksForSpawning, focusing on the eligible-chunk cache and the calls named in the report. Reproduce with FermiumMixins' "Prevent Mob Spawns in Lazy Chunks (Vanilla)" option enabled, then verify that the cache still works and FermiumMixins can inject without the crash.
Written by the indexing model from the issue text.
Description
Environment
Cleanroom 0.6.13-alpha (Java 25), OptiFine 1.12.2 HD_U_G5, OptiRefine built from 78ff8ce, FermiumMixins 1.0.13 with the option Prevent Mob Spawns in Lazy Chunks (Vanilla) turned on.
What happens
The integrated server crashes on its first spawn tick:
org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: @At("INVOKE") on
net/minecraft/world/WorldEntitySpawner::fermiummixins_vanillaWorldEntitySpawner_findChunksForSpawning with priority 1000
cannot inject into net/minecraft/world/WorldEntitySpawner::func_77192_a(Lnet/minecraft/world/WorldServer;ZZZ)I
merged by mods.Hileb.optirefine.mixin.defaults.minecraft.world.MixinWorldEntitySpawner with priority 1000
It is followed by NoClassDefFoundError: net/minecraft/world/WorldEntitySpawner. With the FermiumMixins option off, the world loads normally.
Cause
MixinWorldEntitySpawnerreplacesfindChunksForSpawningwith an@Overwrite, which re-implements OptiFine's eligible-chunk cache.- Mixin does not let another mixin with the same or a lower priority inject into a method that a mixin has merged.
- FermiumMixins'
WorldEntitySpawner_LazyChunksMixinuses the default priority (1000). It has a@WrapOperationonSet.add(Object)and a@ModifyExpressionValueonWorldServer.isAnyPlayerWithinRangeAt(DDDD)Zinside that method. Both calls still exist in OptiRefine's body (eligibleChunksForSpawning.add(chunkpos)andworldServerIn.isAnyPlayerWithinRangeAt(...)). - With the real OptiFine, the class is patched by OptiFine's transformer, not merged by a mixin, so FermiumMixins injects without problems. The conflict exists only with OptiRefine.
Suggestion
Implement the eligible-chunk cache without @Overwrite, for example with a @WrapMethod around the method plus injectors for the cached parts. That keeps findChunksForSpawning open to other mods' injectors, as it is with OptiFine.
Workaround on the FermiumMixins side
Giving WorldEntitySpawner_LazyChunksMixin a priority above 1000 lets it inject into OptiRefine's merged body, because both target calls are still there. Until then, turning off Prevent Mob Spawns in Lazy Chunks (Vanilla) in fermiummixins.cfg avoids the crash.
- Dominant language
- Java
- Stars
- 27
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Ecdcaeb/OptiRefine
-
Difficulty 3/5 1-2 days Newbie friendliness 82/100
Ecdcaeb/OptiRefine#6 ·
-
# Crash when releasing the zoom key: `NoSuchFieldError: acc$mouseFilterXAxis` in `getFOVModifier`Open
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Ecdcaeb/OptiRefine#5 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Ecdcaeb/OptiRefine#2 ·
All issues in Ecdcaeb/OptiRefine
Similar issues
-
[Bug] Lock owned by another client (e.g. Text app) cannot be unlocked from the appPossibly taken @falkloewert claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
oracle/graalvm-reachability-metadata#11026 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
CodeForPhilly/benefit-decision-toolkit#565 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
checkstyle/checkstyle#22050 · 1 comment ·
Maintainers usually reply within 1 day