diff --git a/build.gradle b/build.gradle index 299a5ff..b71cf6c 100644 --- a/build.gradle +++ b/build.gradle @@ -98,6 +98,10 @@ repositories { includeGroup 'curse.maven' } } + maven { + name = "Modrinth" + url = "https://api.modrinth.com/maven" + } mavenLocal() // Must be last for caching to work } @@ -125,7 +129,7 @@ dependencies { transitive = false } } - + compileOnly rfg.deobf("maven.modrinth:scapeandrunparasites:1.9.20") compileOnly rfg.deobf("curse.maven:biomes-o-plenty-220318:2842510") compileOnly rfg.deobf("curse.maven:twilightforest-227639:3051450") compileOnly rfg.deobf("curse.maven:thaumcraft-223628:2629023") diff --git a/src/main/java/org/dimdev/jeid/JEID.java b/src/main/java/org/dimdev/jeid/JEID.java index 2c43c7b..3fb2b16 100644 --- a/src/main/java/org/dimdev/jeid/JEID.java +++ b/src/main/java/org/dimdev/jeid/JEID.java @@ -20,6 +20,7 @@ public class JEID { public static final String NAME = Tags.MOD_NAME; public static final String VERSION = Tags.VERSION; public static final String DEPENDENCIES = "required:mixinbooter@[8.0,);" + + "after:srparasites;" + "after:abyssalcraft;" + "after:advancedrocketry;" + "after:atum;" diff --git a/src/main/java/org/dimdev/jeid/core/JEIDMixinLoader.java b/src/main/java/org/dimdev/jeid/core/JEIDMixinLoader.java index dd4ae50..1fb09a0 100644 --- a/src/main/java/org/dimdev/jeid/core/JEIDMixinLoader.java +++ b/src/main/java/org/dimdev/jeid/core/JEIDMixinLoader.java @@ -16,7 +16,9 @@ public List getMixinConfigs() { configs.add("mixins.jeid.advancedrocketry.client.json"); } } - + if (Loader.isModLoaded("srparasites")) { + configs.add("mixins.jeid.srparasites.json"); + } if (Loader.isModLoaded("abyssalcraft")) { configs.add("mixins.jeid.abyssalcraft.json"); } diff --git a/src/main/java/org/dimdev/jeid/mixin/modsupport/scapeandrunparasites/MixinSpreadBiome.java b/src/main/java/org/dimdev/jeid/mixin/modsupport/scapeandrunparasites/MixinSpreadBiome.java new file mode 100644 index 0000000..b32f1e1 --- /dev/null +++ b/src/main/java/org/dimdev/jeid/mixin/modsupport/scapeandrunparasites/MixinSpreadBiome.java @@ -0,0 +1,42 @@ +package org.dimdev.jeid.mixin.modsupport.scapeandrunparasites; + +import com.dhanantry.scapeandrunparasites.init.SRPBiomes; +import com.dhanantry.scapeandrunparasites.util.ParasiteEventWorld; +import net.minecraft.init.Biomes; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import org.dimdev.jeid.INewChunk; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Pseudo; + +@Pseudo +@Mixin(ParasiteEventWorld.class) +public abstract class MixinSpreadBiome { + + // Overwriting the biome chaning code for SRP. + // This is just a mixin to force it to refer to REID's biome array. + /** + * @author roguetictac + * @reason Make Scape and Run: Parasites compatible with REID. Refer to new chunk duck interface for mixin reasons. + */ + @Overwrite(remap=false) + public static void positionToParasiteBiome(World worldIn, BlockPos pos) { + int inChunkX = pos.getX() & 15; + int inChunkZ = pos.getZ() & 15; + ((INewChunk)worldIn.getChunk(pos)).getIntBiomeArray()[inChunkZ << 4 | inChunkX] = Biome.getIdForBiome(SRPBiomes.biomeInfested); + } + + /** + * @author roguetictac + * @reason Make Scape and Run: Parasites compatible with REID. Refer to new chunk duck interface for mixin reasons. + */ + @Overwrite(remap=false) + public static void positionToBiome(World worldIn, BlockPos pos) { + int inChunkX = pos.getX() & 15; + int inChunkZ = pos.getZ() & 15; + ((INewChunk)worldIn.getChunk(pos)).getIntBiomeArray()[inChunkZ << 4 | inChunkX] = Biome.getIdForBiome(Biomes.PLAINS); + } + +} \ No newline at end of file diff --git a/src/main/resources/mixins.jeid.srparasites.json b/src/main/resources/mixins.jeid.srparasites.json new file mode 100644 index 0000000..148224b --- /dev/null +++ b/src/main/resources/mixins.jeid.srparasites.json @@ -0,0 +1,10 @@ +{ + "package": "org.dimdev.jeid.mixin.modsupport.scapeandrunparasites", + "required": true, + "refmap": "mixins.jeid.refmap.json", + "minVersion": "0.8", + "compatibilityLevel": "JAVA_8", + "mixins": [ + "MixinSpreadBiome" + ] +}