diff --git a/src/main/java/xyz/nucleoid/fantasy/mixin/ServerChunkLoadingManagerMixin.java b/src/main/java/xyz/nucleoid/fantasy/mixin/ServerChunkLoadingManagerMixin.java index 9ec1cf1..2cb9898 100644 --- a/src/main/java/xyz/nucleoid/fantasy/mixin/ServerChunkLoadingManagerMixin.java +++ b/src/main/java/xyz/nucleoid/fantasy/mixin/ServerChunkLoadingManagerMixin.java @@ -2,23 +2,20 @@ import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; +import com.llamalad7.mixinextras.sugar.Local; import net.minecraft.server.world.ServerChunkLoadingManager; import net.minecraft.world.gen.chunk.ChunkGenerator; import net.minecraft.world.gen.chunk.ChunkGeneratorSettings; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import xyz.nucleoid.fantasy.util.ChunkGeneratorSettingsProvider; @Mixin(ServerChunkLoadingManager.class) -public abstract class ServerChunkLoadingManagerMixin { - - @Shadow - public abstract ChunkGenerator getChunkGenerator(); +public class ServerChunkLoadingManagerMixin { @WrapOperation(method = "", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/gen/chunk/ChunkGeneratorSettings;createMissingSettings()Lnet/minecraft/world/gen/chunk/ChunkGeneratorSettings;")) - private ChunkGeneratorSettings fantasy$useProvidedChunkGeneratorSettings(Operation original) { - if (this.getChunkGenerator() instanceof ChunkGeneratorSettingsProvider provider) { + private ChunkGeneratorSettings fantasy$useProvidedChunkGeneratorSettings(Operation original, @Local(argsOnly = true) ChunkGenerator chunkGenerator) { + if (chunkGenerator instanceof ChunkGeneratorSettingsProvider provider) { ChunkGeneratorSettings settings = provider.getSettings(); if (settings != null) return settings; }