mirror of
https://github.com/GTMEGA/EndlessIDs.git
synced 2026-11-12 16:37:49 +00:00
AbyssalCraft compat (fixes #14)
This commit is contained in:
9 files changed
+189
No files matched your search
+63
@@ -0,0 +1,63 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.abyssalcraft;
|
||||
|
||||
import com.falsepattern.endlessids.PlaceholderBiome;
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.shinoow.abyssalcraft.AbyssalCraft;
|
||||
import lombok.val;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
@Mixin(value = AbyssalCraft.class,
|
||||
remap = false)
|
||||
public abstract class AbyssalCraftMixin {
|
||||
@Shadow
|
||||
public static int configBiomeId1;
|
||||
@Shadow
|
||||
public static int configBiomeId2;
|
||||
@Shadow
|
||||
public static int configBiomeId3;
|
||||
@Shadow
|
||||
public static int configBiomeId4;
|
||||
@Shadow
|
||||
public static int configBiomeId5;
|
||||
@Shadow
|
||||
public static int configBiomeId6;
|
||||
@Shadow
|
||||
public static int configBiomeId7;
|
||||
@Shadow
|
||||
public static int configBiomeId8;
|
||||
@Shadow
|
||||
public static int configBiomeId9;
|
||||
@Shadow
|
||||
public static int configBiomeId10;
|
||||
@Shadow
|
||||
public static int configBiomeId11;
|
||||
@Shadow
|
||||
public static int configBiomeId12;
|
||||
@Shadow
|
||||
public static int configBiomeId13;
|
||||
|
||||
@Inject(method = "checkBiomeIds",
|
||||
at = @At("HEAD"),
|
||||
require = 1)
|
||||
private void cleanupBiomeArrayForAssignment(CallbackInfo ci) {
|
||||
val bga = BiomeGenBase.getBiomeGenArray();
|
||||
|
||||
int[] biomes = new int[]{configBiomeId1, configBiomeId2, configBiomeId3, configBiomeId4, configBiomeId5,
|
||||
configBiomeId6, configBiomeId7, configBiomeId8, configBiomeId9, configBiomeId10,
|
||||
configBiomeId11, configBiomeId12, configBiomeId13};
|
||||
for (val biome : biomes) {
|
||||
if (biome < 0 || biome >= ExtendedConstants.biomeIDCount) {
|
||||
continue;
|
||||
}
|
||||
if (bga[biome] instanceof PlaceholderBiome) {
|
||||
bga[biome] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.abyssalcraft;
|
||||
|
||||
import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper;
|
||||
import com.shinoow.abyssalcraft.common.world.ChunkProviderAbyss;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
@Mixin(value = ChunkProviderAbyss.class,
|
||||
remap = false)
|
||||
public abstract class ChunkProviderAbyssMixin {
|
||||
@Shadow
|
||||
private BiomeGenBase[] biomesForGeneration;
|
||||
|
||||
@Redirect(method = "provideChunk",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B",
|
||||
remap = true),
|
||||
remap = true,
|
||||
require = 1)
|
||||
private byte[] setBiomesTweaked(Chunk chunk) {
|
||||
return BiomePatchHelper.getBiomeArrayTweaked(chunk, biomesForGeneration);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.abyssalcraft;
|
||||
|
||||
import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper;
|
||||
import com.shinoow.abyssalcraft.common.world.ChunkProviderDarkRealm;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
@Mixin(value = ChunkProviderDarkRealm.class,
|
||||
remap = false)
|
||||
public abstract class ChunkProviderDarkRealmMixin {
|
||||
@Shadow
|
||||
private BiomeGenBase[] biomesForGeneration;
|
||||
|
||||
@Redirect(method = "provideChunk",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B",
|
||||
remap = true),
|
||||
remap = true,
|
||||
require = 1)
|
||||
private byte[] setBiomesTweaked(Chunk chunk) {
|
||||
return BiomePatchHelper.getBiomeArrayTweaked(chunk, biomesForGeneration);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.abyssalcraft;
|
||||
|
||||
import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper;
|
||||
import com.shinoow.abyssalcraft.common.world.ChunkProviderDreadlands;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
@Mixin(value = ChunkProviderDreadlands.class,
|
||||
remap = false)
|
||||
public abstract class ChunkProviderDreadlandsMixin {
|
||||
@Shadow
|
||||
private BiomeGenBase[] biomesForGeneration;
|
||||
|
||||
@Redirect(method = "provideChunk",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B",
|
||||
remap = true),
|
||||
remap = true,
|
||||
require = 1)
|
||||
private byte[] setBiomesTweaked(Chunk chunk) {
|
||||
return BiomePatchHelper.getBiomeArrayTweaked(chunk, biomesForGeneration);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.abyssalcraft;
|
||||
|
||||
import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper;
|
||||
import com.shinoow.abyssalcraft.common.world.ChunkProviderOmothol;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
@Mixin(value = ChunkProviderOmothol.class,
|
||||
remap = false)
|
||||
public abstract class ChunkProviderOmotholMixin {
|
||||
@Shadow
|
||||
private BiomeGenBase[] biomesForGeneration;
|
||||
|
||||
@Redirect(method = "provideChunk",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B",
|
||||
remap = true),
|
||||
remap = true,
|
||||
require = 1)
|
||||
private byte[] setBiomesTweaked(Chunk chunk) {
|
||||
return BiomePatchHelper.getBiomeArrayTweaked(chunk, biomesForGeneration);
|
||||
}
|
||||
}
|
||||
@@ -58,6 +58,15 @@ public enum Mixin implements IMixin {
|
||||
RenderGlobalMixin(Side.CLIENT, always(), "vanilla.RenderGlobalMixin"),
|
||||
//endregion Minecraft->client
|
||||
//endregion Minecraft
|
||||
//region AbyssalCraft->common
|
||||
AbyssalCraftMixin(Side.COMMON, require(TargetedMod.ABYSSALCRAFT), "abyssalcraft.AbyssalCraftMixin"),
|
||||
ChunkProviderAbyssMixin(Side.COMMON, require(TargetedMod.ABYSSALCRAFT), "abyssalcraft.ChunkProviderAbyssMixin"),
|
||||
ChunkProviderDarkRealmMixin(Side.COMMON, require(TargetedMod.ABYSSALCRAFT),
|
||||
"abyssalcraft.ChunkProviderDarkRealmMixin"),
|
||||
ChunkProviderDreadlandsMixin(Side.COMMON, require(TargetedMod.ABYSSALCRAFT),
|
||||
"abyssalcraft.ChunkProviderDreadlandsMixin"),
|
||||
ChunkProviderOmotholMixin(Side.COMMON, require(TargetedMod.ABYSSALCRAFT), "abyssalcraft.ChunkProviderOmotholMixin"),
|
||||
//endregion AbyssalCraft->common
|
||||
//region ATG->common
|
||||
ATGBiomeConfigMixin(Side.COMMON, require(TargetedMod.ATG), "atg.ATGBiomeConfigMixin"),
|
||||
ATGBiomeManagerMixin(Side.COMMON, require(TargetedMod.ATG), "atg.ATGBiomeManagerMixin"),
|
||||
|
||||
@@ -11,6 +11,7 @@ import static com.falsepattern.lib.mixin.ITargetedMod.PredicateHelpers.startsWit
|
||||
@RequiredArgsConstructor
|
||||
public enum TargetedMod implements ITargetedMod {
|
||||
|
||||
ABYSSALCRAFT("AbyssalCraft", true, startsWith("abyssalcraft-")),
|
||||
ATG("Alternate Terrain Generation", true, startsWith("atg")),
|
||||
ANTIQUEATLAS("Antique Atlas", true, startsWith("antiqueatlas")),
|
||||
ANTIIDCONFLICT("Anti ID Conflict", true, startsWith("antiidconflict")),
|
||||
|
||||
Reference in new issue
Block a user