Skip to content

Commit

Permalink
fix crash with new version of mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
qouteall committed Dec 12, 2021
1 parent 11f4665 commit 7feb222
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,31 @@
import net.minecraft.world.chunk.ChunkStatus;
import net.minecraft.world.chunk.IChunk;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.WorldGenRegion;
import net.minecraft.world.server.ServerWorld;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.List;

@Mixin(ChunkStatus.class)
public class MixinChunkStatus {
@Inject(
@Redirect(
method = "*",
at = @At(
value = "INVOKE",
shift = At.Shift.AFTER,
target = "Lnet/minecraft/world/gen/ChunkGenerator;generateSurface(Lnet/minecraft/world/gen/WorldGenRegion;Lnet/minecraft/world/chunk/IChunk;)V"
)
)
private static void redirectBuildSurface(
ServerWorld world, ChunkGenerator generator, List<IChunk> surroundingChunks, IChunk chunk,
CallbackInfo ci
private static void redirectGenerateSurface(
ChunkGenerator chunkGenerator,
WorldGenRegion region, IChunk chunk
) {
AltiusInfo.replaceBedrock(world, chunk);
chunkGenerator.generateSurface(region, chunk);
AltiusInfo.replaceBedrock(region.getWorld(), chunk);
}

}

0 comments on commit 7feb222

Please sign in to comment.