mirror of
https://github.com/GTMEGA/EndlessIDs.git
synced 2026-11-12 04:57:31 +00:00
GalaxySpace compat
This commit is contained in:
7 files changed
+154
No files matched your search
@@ -0,0 +1,38 @@
|
||||
package com.falsepattern.endlessids.mixin.helpers;
|
||||
|
||||
import com.falsepattern.endlessids.EndlessIDs;
|
||||
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
public class GalaxySpaceHelper {
|
||||
private static final Field GSSpaceField;
|
||||
static {
|
||||
Class<?> clazz;
|
||||
try {
|
||||
clazz = Class.forName("galaxyspace.core.world.gen.GSBiomeGenBase");
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
EndlessIDs.LOG.warn("Could not find GalaxySpace's GSBiomeGenBase class in the default package. Checking it in the MEGA package.");
|
||||
try {
|
||||
clazz = Class.forName("galaxyspace.core.world.GSBiomeGenBase");
|
||||
} catch (ClassNotFoundException ignored2) {
|
||||
EndlessIDs.LOG.warn("Could not find GalaxySpace's GSBiomeGenBase class in the MEGA package either. Throwing an exception.");
|
||||
throw new IllegalStateException("Could not find GSBiomeGenBase class for GalaxySpace!");
|
||||
}
|
||||
}
|
||||
try {
|
||||
GSSpaceField = clazz.getDeclaredField("GSSpace");
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new IllegalStateException("Could not find GSSpace field in GSBiomeGenBase class for GalaxySpace!");
|
||||
}
|
||||
}
|
||||
|
||||
public static BiomeGenBase GSSpace() {
|
||||
try {
|
||||
return (BiomeGenBase) GSSpaceField.get(null);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new IllegalStateException("Could not access GSSpace field in GSBiomeGenBase class for GalaxySpace!");
|
||||
}
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.galaxyspace;
|
||||
|
||||
import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper;
|
||||
import com.falsepattern.endlessids.mixin.helpers.GalaxySpaceHelper;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Pseudo;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
@Pseudo
|
||||
@Mixin(targets = {"galaxyspace.systems.SolarSystem.planets.kuiperbelt.dimension.ChunkProviderKuiper",
|
||||
"galaxyspace.SolarSystem.planets.kuiperbelt.dimension.ChunkProviderKuiper"},
|
||||
remap = false)
|
||||
public abstract class ChunkProviderKuiperMixin {
|
||||
@SuppressWarnings("UnresolvedMixinReference")
|
||||
@Redirect(method = "func_73154_d",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/chunk/Chunk;func_76605_m()[B"),
|
||||
require = 0,
|
||||
expect = 0)
|
||||
private byte[] setBiomesTweaked(Chunk chunk) {
|
||||
return BiomePatchHelper.getBiomeArrayTweaked(chunk, (i) -> GalaxySpaceHelper.GSSpace());
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.galaxyspace;
|
||||
|
||||
import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper;
|
||||
import com.falsepattern.endlessids.mixin.helpers.GalaxySpaceHelper;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Pseudo;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
@Pseudo
|
||||
@Mixin(targets = {"galaxyspace.systems.SolarSystem.satellites.mars.dimension.ChunkProviderMarsSS",
|
||||
"galaxyspace.SolarSystem.satellites.mars.dimension.ChunkProviderMarsSS"},
|
||||
remap = false)
|
||||
public abstract class ChunkProviderMarsSSMixin {
|
||||
|
||||
@SuppressWarnings("UnresolvedMixinReference")
|
||||
@Redirect(method = "func_73154_d",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/chunk/Chunk;func_76605_m()[B"),
|
||||
require = 0,
|
||||
expect = 0)
|
||||
private byte[] setBiomesTweaked(Chunk chunk) {
|
||||
return BiomePatchHelper.getBiomeArrayTweaked(chunk, (i) -> GalaxySpaceHelper.GSSpace());
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.galaxyspace;
|
||||
|
||||
import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Pseudo;
|
||||
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;
|
||||
|
||||
@Pseudo
|
||||
@Mixin(targets = {"galaxyspace.core.world.gen.ChunkProviderSpaceLakes",
|
||||
"galaxyspace.core.world.ChunkProviderSpaceLakes"},
|
||||
remap = false)
|
||||
public abstract class ChunkProviderSpaceLakesMixin {
|
||||
@Shadow
|
||||
private BiomeGenBase[] biomesForGeneration;
|
||||
|
||||
@SuppressWarnings("UnresolvedMixinReference")
|
||||
@Redirect(method = "func_73154_d",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/chunk/Chunk;func_76605_m()[B"),
|
||||
require = 0,
|
||||
expect = 0)
|
||||
private byte[] setBiomesTweaked(Chunk chunk) {
|
||||
return BiomePatchHelper.getBiomeArrayTweaked(chunk, biomesForGeneration);
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.galaxyspace;
|
||||
|
||||
import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper;
|
||||
import com.falsepattern.endlessids.mixin.helpers.GalaxySpaceHelper;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Pseudo;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
@Pseudo
|
||||
@Mixin(targets = {"galaxyspace.systems.SolarSystem.satellites.venus.dimension.ChunkProviderVenusSS",
|
||||
"galaxyspace.SolarSystem.satellites.venus.dimension.ChunkProviderVenusSS"},
|
||||
remap = false)
|
||||
public abstract class ChunkProviderVenusSSMixin {
|
||||
|
||||
@SuppressWarnings("UnresolvedMixinReference")
|
||||
@Redirect(method = "func_73154_d",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/chunk/Chunk;func_76605_m()[B"),
|
||||
require = 1)
|
||||
private byte[] setBiomesTweaked(Chunk chunk) {
|
||||
return BiomePatchHelper.getBiomeArrayTweaked(chunk, (i) -> GalaxySpaceHelper.GSSpace());
|
||||
}
|
||||
}
|
||||
@@ -148,6 +148,12 @@ public enum Mixin implements IMixin {
|
||||
GalactiCraftConfigManagerCoreMixin(Side.COMMON, require(TargetedMod.GALACTICRAFTCORE),
|
||||
"galacticraft.ConfigManagerCoreMixin"),
|
||||
//endregion GalactiCraftCore->common
|
||||
//region GalaxySpace->common
|
||||
GSChunkProviderKuiperMixin(Side.COMMON, require(TargetedMod.GALAXYSPACE), "galaxyspace.ChunkProviderKuiperMixin"),
|
||||
GSChunkProviderMarsSSMixin(Side.COMMON, require(TargetedMod.GALAXYSPACE), "galaxyspace.ChunkProviderMarsSSMixin"),
|
||||
GSChunkProviderSpaceLakesMixin(Side.COMMON, require(TargetedMod.GALAXYSPACE), "galaxyspace.ChunkProviderSpaceLakesMixin"),
|
||||
GSChunkProviderVenusSSMixin(Side.COMMON, require(TargetedMod.GALAXYSPACE), "galaxyspace.ChunkProviderVenusSSMixin"),
|
||||
//endregion GalaxySpace->common
|
||||
//region Highlands->common
|
||||
HighlandsConfigMixin(Side.COMMON, require(TargetedMod.HIGHLANDS), "highlands.ConfigMixin"),
|
||||
//endregion Highlands->common
|
||||
|
||||
@@ -32,6 +32,7 @@ public enum TargetedMod implements ITargetedMod {
|
||||
EXTRAUTILITIES("Extra Utilities", true, startsWith("extrautilities-")),
|
||||
FUTUREPACK("Futurepack", true, startsWith("[1.7.10]futurepack").or(startsWith("futurepack-"))),
|
||||
GALACTICRAFTCORE("GalactiCraftCore", false, startsWith("galacticraftcore")),
|
||||
GALAXYSPACE("GalaxySpace", false, startsWith("galaxyspace-")),
|
||||
HIGHLANDS("Highlands", true, startsWith("highlands")),
|
||||
ICG("Immersive Cavegen", true, startsWith("immersivecavegen")),
|
||||
LOTR("LOTR Mod", false, startsWith("lotrmod")),
|
||||
|
||||
Reference in new issue
Block a user