Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

# `@Overwrite` of `WorldEntitySpawner.findChunksForSpawning` blocks other mods' injectors (crash with FermiumMixins)

Open
#7 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
game-dev

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

  • MixinWorldEntitySpawner replaces findChunksForSpawning with 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_LazyChunksMixin uses the default priority (1000). It has a @WrapOperation on Set.add(Object) and a @ModifyExpressionValue on WorldServer.isAnyPlayerWithinRangeAt(DDDD)Z inside that method. Both calls still exist in OptiRefine's body (eligibleChunksForSpawning.add(chunkpos) and worldServerIn.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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Ecdcaeb/OptiRefine

All issues in Ecdcaeb/OptiRefine

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.