Skip to content

Commit

Permalink
Merge pull request #2 from pugur523/master
Browse files Browse the repository at this point in the history
fix compatibility issue with mc1.21
  • Loading branch information
topi-banana authored Dec 6, 2024
2 parents faff6db + fb862b2 commit 858cc7e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/matrix_includes.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"subproject_dir": "1.20.2"
},
{
"subproject_dir": "1.21.1"
"subproject_dir": "1.21.2"
},
{
"subproject_dir": "1.21.4"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,21 @@ public class ServerChunkCacheMixin

@Unique
private static final String targetMethod =
//#if MC >= 11800
//#if MC >= 12100
//$$ "tickChunks(Lnet/minecraft/util/profiling/ProfilerFiller;JLjava/util/List;)V";
//#elseif MC >= 11800
//$$ "tickChunks()V";
//#else
"method_20801";
//#endif

//#if MC >= 12100
//$$ @WrapWithCondition(method = targetMethod, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/NaturalSpawner;spawnForChunk(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/level/chunk/LevelChunk;Lnet/minecraft/world/level/NaturalSpawner$SpawnState;Ljava/util/List;)V"))
//$$ private boolean shouldSpawnMobs(ServerLevel a, LevelChunk levelChunk, SpawnState b, List c)
//#else
@WrapWithCondition(method = targetMethod, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/NaturalSpawner;spawnForChunk(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/level/chunk/LevelChunk;Lnet/minecraft/world/level/NaturalSpawner$SpawnState;ZZZ)V"))
private boolean shouldSpawnMobs(ServerLevel a, LevelChunk levelChunk, SpawnState b, boolean c, boolean d, boolean e)
//#endif
{
return ((IChunkMap)chunkMap).anyPlayerCloseWithInteraction(levelChunk.getPos(), Interaction.MOBSPAWNING);
}
Expand Down

0 comments on commit 858cc7e

Please sign in to comment.