Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Scape and Run: Parasites #54

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/dimdev/jeid/JEID.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;"
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/dimdev/jeid/core/JEIDMixinLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ public List<String> 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");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}

}
10 changes: 10 additions & 0 deletions src/main/resources/mixins.jeid.srparasites.json
Original file line number Diff line number Diff line change
@@ -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"
]
}