Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

Commit

Permalink
CyclopsCore support
Browse files Browse the repository at this point in the history
Replace WorldHelpers#setBiome in CyclopsCore so that EvilCraft and other dependencies can update the biome as intended
  • Loading branch information
sam-kirby committed Apr 5, 2019
1 parent 5657809 commit 86a569c
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 2 deletions.
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ apply plugin: 'org.spongepowered.mixin'

def buildnumber = System.getenv('TRAVIS_BUILD_NUMBER')
def suffix = buildnumber != null ? ".$buildnumber" : "-SNAPSHOT"
version = "1.1.0$suffix"
version = "1.2.0$suffix"
group = "uk.bobbytables.jeidsi" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "jeidsi"

Expand All @@ -29,6 +29,9 @@ minecraft {
mappings "stable_39"
makeObfSourceJar false // an Srg named sources jar is made by default. uncomment this to disable.

replaceIn "JEIDsI.java"
replace "@VERSION@", project.version

def args = [
'-Dfml.coreMods.load=uk.bobbytables.jeidsi.JEIDsILoadingPlugin',
'-Dmixin.hotSwap=true',
Expand Down Expand Up @@ -56,6 +59,7 @@ dependencies {

compileOnly '2691:339:AbyssalCraft-1.12.2-1.9.6@jar'
compileOnly '2683:823:Bookshelf-1.12.2-2.3.577@jar'
compileOnly '2691:93:CyclopsCore-1.12.2-1.1.1@jar'
compileOnly '2678:374:extrautils2-1.12-1.9.9@jar'
compileOnly '2683:667:TheBetweenlands-3.4.6-universal@jar'
compileOnly '2692:524:TofuCraftReload-0.0.2.1@jar'
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/uk/bobbytables/jeidsi/JEIDsI.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class JEIDsI {
public static final String MODID = "jeidsi";
public static final String NAME = "JustEnoughIDs Integration";
public static final String VERSION = "1.0.0";
public static final String VERSION = "@VERSION@";

public static final Logger LOGGER = LogManager.getLogger("JEIDsI");

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package uk.bobbytables.jeidsi.compat.cyclopscore.mixins;

import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import org.cyclops.cyclopscore.helper.WorldHelpers;
import org.dimdev.jeid.INewChunk;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import uk.bobbytables.jeidsi.network.JEIDsIPacketHandler;
import uk.bobbytables.jeidsi.network.client.BiomeChangeMessage;

@Mixin(WorldHelpers.class)
public class MixinWorldHelpers {
@Overwrite
public static void setBiome(World world, BlockPos pos, Biome biome) {
Chunk chunk = world.getChunk(pos);
((INewChunk) chunk).getIntBiomeArray()[(pos.getZ() & 0xF) << 4 | pos.getX() & 0xF] = Biome.getIdForBiome(biome);
chunk.markDirty();
if (!world.isRemote) {
JEIDsIPacketHandler.INSTANCE.sendToAllAround(
new BiomeChangeMessage(pos.getX(), pos.getZ(), Biome.getIdForBiome(biome)),
new NetworkRegistry.TargetPoint(world.provider.getDimension(), pos.getX(), 128.0D, pos.getZ(), 128.0D)
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class MixinLoader {
private void beforeModSupportMixins(List<String> injectedModContainers, CallbackInfo ci) {
Mixins.addConfiguration("mixins.jeidsi.abyssalcraft.json");
Mixins.addConfiguration("mixins.jeidsi.bookshelf.json");
Mixins.addConfiguration("mixins.jeidsi.cyclopscore.json");
Mixins.addConfiguration("mixins.jeidsi.extrautils2.json");
Mixins.addConfiguration("mixins.jeidsi.tofucraft.json");
Mixins.addConfiguration("mixins.jeidsi.thebetweenlands.json");
Expand Down
11 changes: 11 additions & 0 deletions src/main/resources/mixins.jeidsi.cyclopscore.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"package": "uk.bobbytables.jeidsi.compat.cyclopscore",
"required": true,
"refmap": "mixins.jeidsi.refmap.json",
"target": "@env(DEFAULT)",
"minVersion": "0.6",
"compatibilityLevel": "JAVA_8",
"mixins": [
"mixins.MixinWorldHelpers"
]
}

0 comments on commit 86a569c

Please sign in to comment.