forked from DimensionalDevelopment/JustEnoughIDs
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from Axis-Denied/master
Added support for Scape and Run: Parasites
- Loading branch information
Showing
5 changed files
with
61 additions
and
2 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
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
42 changes: 42 additions & 0 deletions
42
src/main/java/org/dimdev/jeid/mixin/modsupport/scapeandrunparasites/MixinSpreadBiome.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 |
---|---|---|
@@ -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); | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -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" | ||
] | ||
} |