forked from micdoodle8/Galacticraft
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "Revert ChunkProviderServerMixin.java""
This reverts commit bbbc50a.
- Loading branch information
1 parent
958f6d6
commit 33167d2
Showing
1 changed file
with
11 additions
and
8 deletions.
There are no files selected for viewing
19 changes: 11 additions & 8 deletions
19
...ain/java/micdoodle8/mods/galacticraft/core/mixins/minecraft/ChunkProviderServerMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |