mirror of
https://github.com/GTMEGA/EndlessIDs.git
synced 2026-11-16 21:05:01 +00:00
Thaumcraft compat
This commit is contained in:
5 files changed
+46
No files matched your search
+39
@@ -0,0 +1,39 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.thaumcraft;
|
||||
|
||||
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import thaumcraft.common.lib.network.PacketHandler;
|
||||
import thaumcraft.common.lib.network.misc.PacketBiomeChange;
|
||||
import thaumcraft.common.lib.utils.Utils;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
|
||||
@Mixin(value = Utils.class,
|
||||
remap = false)
|
||||
public abstract class UtilsMixin {
|
||||
|
||||
/**
|
||||
* @author FalsePattern
|
||||
* @reason Biome ID Extension
|
||||
*/
|
||||
@Overwrite
|
||||
public static void setBiomeAt(World world, int x, int z, BiomeGenBase biome) {
|
||||
if (biome != null) {
|
||||
Chunk chunk = world.getChunkFromBlockCoords(x, z);
|
||||
short[] array = ((IChunkMixin)chunk).getBiomeShortArray();
|
||||
array[(z & 15) << 4 | x & 15] = (short)(biome.biomeID);
|
||||
if (!world.isRemote) {
|
||||
PacketHandler.INSTANCE.sendToAllAround(new PacketBiomeChange(x, z, (short)biome.biomeID),
|
||||
new NetworkRegistry.TargetPoint(world.provider.dimensionId,
|
||||
x,
|
||||
world.getHeightValue(x, z),
|
||||
z,
|
||||
32.0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -118,6 +118,9 @@ public enum Mixin implements IMixin {
|
||||
RTGLandscapeGeneratorMixin(Side.COMMON, require(TargetedMod.RTG), "rtg.LandscapeGeneratorMixin"),
|
||||
RTGRealisticBiomeBaseMixin(Side.COMMON, require(TargetedMod.RTG), "rtg.RealisticBiomeBaseMixin"),
|
||||
//endregion RTG->common
|
||||
//region Thaumcraft->common
|
||||
ThaumcraftUtilsMixin(Side.COMMON, require(TargetedMod.THAUMCRAFT), "thaumcraft.UtilsMixin"),
|
||||
//endregion Thaumcraft->common
|
||||
//region TwilightForest->common
|
||||
ChunkProviderTwilightForestMixin(Side.COMMON, require(TargetedMod.TWILIGHTFOREST),
|
||||
"twilightforest.ChunkProviderTwilightForestMixin"),
|
||||
|
||||
@@ -21,6 +21,7 @@ public enum TargetedMod implements ITargetedMod {
|
||||
MFQM("More Fun Quicksand Mod", false, startsWith("morefunquicksandmod-")),
|
||||
NATURESCOMPASS("Nature's Compass", true, startsWith("naturescompass")),
|
||||
RTG("Realistic Terrain Generation", true, startsWith("rtg-")),
|
||||
THAUMCRAFT("Thaumcraft", true, startsWith("thaumcraft")),
|
||||
TWILIGHTFOREST("Twilight Forest", true, startsWith("twilightforest")),
|
||||
UBC("Underground Biomes Constructs", false, startsWith("undergroundbiomesconstructs-")),
|
||||
WORLDEDIT("WorldEdit", false, startsWith("worldedit-")),
|
||||
|
||||
Reference in new issue
Block a user