mirror of
https://github.com/GTMEGA/EndlessIDs.git
synced 2026-11-17 15:45:05 +00:00
Antique Atlas compat
This commit is contained in:
7 files changed
+115
No files matched your search
@@ -16,6 +16,7 @@ Comparison of the known limits:
|
||||
This mod also contains patches for the following mods:
|
||||
|
||||
- Alternate Terrain Generation
|
||||
- Antique Atlas
|
||||
- Anti ID Conflict
|
||||
- ArchaicFix
|
||||
- Biomes O' Plenty
|
||||
|
||||
@@ -23,6 +23,7 @@ dependencies {
|
||||
compile(deobfMaven(curseMaven, "curse.maven:twilightforest-227639:3039937")) // 2.3.8
|
||||
compile(deobfMaven(curseMaven, "curse.maven:thaumcraft-223628:2227552")) // 4.2.3.5
|
||||
compile(deobfMaven(curseMaven, "curse.maven:baubles-227083:2224857")) // 1.0.1.10, dependency of thaumcraft
|
||||
compile(deobfMaven(curseMaven, "curse.maven:antiqueatlas-227795:2454232")) // 4.4.4
|
||||
compile("com.github.embeddedt:ArchaicFix:be8666cb2dbf2e0a8b799e88cef3c0d12e5d4911:dev")
|
||||
compileOnly(deobf("https://micdoodle8.com/new-builds/GC-1.7/504/GalacticraftCore-1.7-3.0.12.504.jar"))
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.falsepattern.endlessids.mixin.helpers;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public final class ShortUtil {
|
||||
public static int unsignedShortToInt(short s) {
|
||||
return s & 65535;
|
||||
}
|
||||
|
||||
public static int[] unsignedShortToIntArray(short[] shorts) {
|
||||
int[] ints = new int[shorts.length];
|
||||
|
||||
for(int i = 0; i < shorts.length; ++i) {
|
||||
ints[i] = unsignedShortToInt(shorts[i]);
|
||||
}
|
||||
|
||||
return ints;
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.antiqueatlas;
|
||||
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.constants.VanillaConstants;
|
||||
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
|
||||
import com.falsepattern.endlessids.mixin.helpers.ShortUtil;
|
||||
import hunternif.mc.atlas.core.BiomeDetectorBase;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
@Mixin(value = BiomeDetectorBase.class,
|
||||
remap = false)
|
||||
public abstract class BiomeDetectorBaseMixin {
|
||||
@ModifyConstant(method = "<clinit>",
|
||||
constant = @Constant(intValue = VanillaConstants.biomeIDCount),
|
||||
require = 2)
|
||||
private static int extendIDs(int constant) {
|
||||
return ExtendedConstants.biomeIDCount;
|
||||
}
|
||||
|
||||
private Chunk chunk;
|
||||
|
||||
@Redirect(method = "getBiomeID",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B",
|
||||
remap = true),
|
||||
require = 1)
|
||||
private byte[] disableGetter(Chunk instance) {
|
||||
chunk = instance;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Redirect(method = "getBiomeID",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lhunternif/mc/atlas/util/ByteUtil;unsignedByteToIntArray([B)[I"),
|
||||
require = 1)
|
||||
private int[] biomeIDs(byte[] i) {
|
||||
try {
|
||||
return ShortUtil.unsignedShortToIntArray(((IChunkMixin)chunk).getBiomeShortArray());
|
||||
} finally {
|
||||
chunk = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.antiqueatlas;
|
||||
|
||||
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
|
||||
import com.falsepattern.endlessids.mixin.helpers.ShortUtil;
|
||||
import hunternif.mc.atlas.core.BiomeDetectorNether;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
@Mixin(value = BiomeDetectorNether.class,
|
||||
remap = false)
|
||||
public abstract class BiomeDetectorNetherMixin {
|
||||
private Chunk chunk;
|
||||
|
||||
@Redirect(method = "getBiomeID",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B",
|
||||
remap = true),
|
||||
require = 1)
|
||||
private byte[] disableGetter(Chunk instance) {
|
||||
chunk = instance;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Redirect(method = "getBiomeID",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lhunternif/mc/atlas/util/ByteUtil;unsignedByteToIntArray([B)[I"),
|
||||
require = 1)
|
||||
private int[] biomeIDs(byte[] i) {
|
||||
try {
|
||||
return ShortUtil.unsignedShortToIntArray(((IChunkMixin)chunk).getBiomeShortArray());
|
||||
} finally {
|
||||
chunk = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,6 +71,10 @@ public enum Mixin implements IMixin {
|
||||
AIDCEntitiesManagerMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT), "antiidconflict.EntitiesManagerMixin"),
|
||||
AIDCPotionsManagerMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT), "antiidconflict.PotionsManagerMixin"),
|
||||
//endregion AntiIDConflict->common
|
||||
//region AntiqueAtlas->commond
|
||||
BiomeDetectorBaseMixin(Side.COMMON, require(TargetedMod.ANTIQUEATLAS), "antiqueatlas.BiomeDetectorBaseMixin"),
|
||||
BiomeDetectorNetherMixin(Side.COMMON, require(TargetedMod.ANTIQUEATLAS), "antiqueatlas.BiomeDetectorNetherMixin"),
|
||||
//endregion AntiqueAtlas->commond
|
||||
//region ATG->common
|
||||
ATGBiomeConfigMixin(Side.COMMON, require(TargetedMod.ATG), "atg.ATGBiomeConfigMixin"),
|
||||
ATGBiomeManagerMixin(Side.COMMON, require(TargetedMod.ATG), "atg.ATGBiomeManagerMixin"),
|
||||
|
||||
@@ -12,6 +12,7 @@ import static com.falsepattern.lib.mixin.ITargetedMod.PredicateHelpers.startsWit
|
||||
public enum TargetedMod implements ITargetedMod {
|
||||
|
||||
ANTIIDCONFLICT("Anti ID Conflict", true, startsWith("antiidconflict")),
|
||||
ANTIQUEATLAS("Antique Atlas", true, startsWith("antiqueatlas")),
|
||||
ATG("Alternate Terrain Generation", true, startsWith("atg")),
|
||||
BOP("Biomes O' Plenty", true, startsWith("biomesoplenty-")),
|
||||
COFHLIB("CoFH Lib", true, startsWith("cofhlib-")),
|
||||
|
||||
Reference in new issue
Block a user