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.
* let's see if this works... * fix mistake * add missing `@Overwrite` * Update build.gradle * Add recommended javadoc * Fix refmap value in early Mixins JSON * Quick fix * Revert "Quick fix" This reverts commit c7b15ec. * Revert ChunkProviderServerMixin.java * Revert "Revert ChunkProviderServerMixin.java" This reverts commit 5365b21. * update BS * Revert "Revert "Revert ChunkProviderServerMixin.java"" This reverts commit bbbc50a. * Revert "Revert "Revert "Revert ChunkProviderServerMixin.java""" This reverts commit 33167d2. * update BS Signed-off-by: Glease <[email protected]> * spotlessApply (#61) Co-authored-by: Martin Robertz <[email protected]> Co-authored-by: GitHub GTNH Actions <> * Swap back chunkProvider and chunkGenerator parameters Signed-off-by: Glease <[email protected]> Co-authored-by: glowredman <[email protected]> Co-authored-by: kuba6000 <[email protected]> Co-authored-by: Glease <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
faa60e7
commit 5d4d901
Showing
7 changed files
with
39 additions
and
16 deletions.
There are no files selected for viewing
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
19 changes: 8 additions & 11 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,30 +1,27 @@ | ||
package micdoodle8.mods.galacticraft.core.mixins.minecraft; | ||
|
||
import cpw.mods.fml.common.registry.GameRegistry; | ||
import com.gtnewhorizon.mixinextras.injector.WrapWithCondition; | ||
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 { | ||
|
||
@Redirect( | ||
method = "populate(Lnet/minecraft/world/chunk/IChunkProvider;II)V", | ||
@WrapWithCondition( | ||
at = | ||
@At( | ||
value = "INVOKE", | ||
remap = false, | ||
target = | ||
"Lcpw/mods/fml/common/registry/GameRegistry;generateWorld(IILnet/minecraft/world/World;Lnet/minecraft/world/chunk/IChunkProvider;Lnet/minecraft/world/chunk/IChunkProvider;)V", | ||
remap = false), | ||
value = "INVOKE"), | ||
method = "populate(Lnet/minecraft/world/chunk/IChunkProvider;II)V", | ||
require = 1) | ||
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); | ||
} | ||
private boolean checkOtherModPreventGenerate( | ||
int chunkX, int chunkZ, World world, IChunkProvider chunkProvider, IChunkProvider chunkGenerator) { | ||
return !WorldUtil.otherModPreventGenerate(chunkX, chunkZ, world, chunkProvider, chunkGenerator); | ||
} | ||
} |
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
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
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
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
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