Skip to content

Commit

Permalink
Revert "Revert "Revert ChunkProviderServerMixin.java""
Browse files Browse the repository at this point in the history
This reverts commit bbbc50a.
  • Loading branch information
Dream-Master committed Dec 10, 2022
1 parent 958f6d6 commit 33167d2
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
package micdoodle8.mods.galacticraft.core.mixins.minecraft;

import com.gtnewhorizon.mixinextras.injector.WrapWithCondition;
import cpw.mods.fml.common.registry.GameRegistry;
import micdoodle8.mods.galacticraft.core.util.WorldUtil;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.ChunkProviderServer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(ChunkProviderServer.class)
public class ChunkProviderServerMixin {

@WrapWithCondition(
@Redirect(
method = "populate(Lnet/minecraft/world/chunk/IChunkProvider;II)V",
at =
@At(
remap = false,
value = "INVOKE",
target =
"Lcpw/mods/fml/common/registry/GameRegistry;generateWorld(IILnet/minecraft/world/World;Lnet/minecraft/world/chunk/IChunkProvider;Lnet/minecraft/world/chunk/IChunkProvider;)V",
value = "INVOKE"),
method = "populate(Lnet/minecraft/world/chunk/IChunkProvider;II)V",
remap = false),
require = 1)
private boolean checkOtherModPreventGenerate(
int chunkX, int chunkZ, World world, IChunkProvider chunkProvider, IChunkProvider chunkGenerator) {
return !WorldUtil.otherModPreventGenerate(chunkX, chunkZ, world, chunkGenerator, chunkProvider);
private void onRegistry(
int chunkX, int chunkZ, World world, IChunkProvider currentChunkProvider, IChunkProvider chunkGenerator) {
if (!WorldUtil.otherModPreventGenerate(chunkX, chunkZ, world, currentChunkProvider, chunkGenerator)) {
GameRegistry.generateWorld(chunkX, chunkZ, world, currentChunkProvider, chunkGenerator);
}
}
}

0 comments on commit 33167d2

Please sign in to comment.