mirror of
https://github.com/GTMEGA/EndlessIDs.git
synced 2026-11-18 19:39:11 +00:00
ThutCore/ThutMods compat (#175)
This commit is contained in:
5 files changed
+53
No files matched your search
+44
@@ -0,0 +1,44 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.biome.thut;
|
||||
|
||||
import com.falsepattern.endlessids.mixin.helpers.ChunkBiomeHook;
|
||||
import lombok.val;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import thut.api.maths.Vector3;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
@Mixin(value = Vector3.class,
|
||||
remap = false)
|
||||
public abstract class Vector3Mixin {
|
||||
|
||||
@Shadow public abstract int intX();
|
||||
|
||||
@Shadow public abstract int intZ();
|
||||
|
||||
/**
|
||||
* @author FalsePattern
|
||||
* @reason ID Extension
|
||||
*/
|
||||
@Overwrite
|
||||
public void setBiome(BiomeGenBase biome, World worldObj) {
|
||||
int x = this.intX();
|
||||
int z = this.intZ();
|
||||
Chunk chunk = worldObj.getChunkFromBlockCoords(x, z);
|
||||
val chunkHook = (ChunkBiomeHook) chunk;
|
||||
short[] biomes = chunkHook.getBiomeShortArray();
|
||||
short newBiome = (short)biome.biomeID;
|
||||
int chunkX = Math.abs(x & 15);
|
||||
int chunkZ = Math.abs(z & 15);
|
||||
int point = chunkX + 16 * chunkZ;
|
||||
if (biomes[point] != newBiome) {
|
||||
biomes[point] = newBiome;
|
||||
chunkHook.setBiomeShortArray(biomes);
|
||||
chunk.setChunkModified();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -159,6 +159,9 @@ public enum Mixin implements IMixin {
|
||||
//region Thaumcraft
|
||||
ThaumcraftUtilsMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.THAUMCRAFT)), "biome.thaumcraft.UtilsMixin"),
|
||||
//endregion Thaumcraft
|
||||
//region ThutCore
|
||||
ThutVector3Mixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.THUTCORE)), "biome.thut.Vector3Mixin"),
|
||||
//endregion ThutCore
|
||||
//region Tropicraft
|
||||
GenLayerTropiVoronoiZoomMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.TROPICRAFT)), "biome.tropicraft.GenLayerTropiVoronoiZoomMixin"),
|
||||
//endregion Tropicraft
|
||||
|
||||
@@ -48,6 +48,7 @@ public enum TargetedMod implements ITargetedMod {
|
||||
RTG("Realistic Terrain Generation", false, startsWith("rtg-")),
|
||||
RWG("Realistic World Gen", false, startsWith("rwg-")),
|
||||
THAUMCRAFT("Thaumcraft", false, startsWith("thaumcraft")),
|
||||
THUTCORE("ThutCore", false, startsWith("thutcore-").or(startsWith("thutmods-"))),
|
||||
TROPICRAFT("Tropicraft", false, startsWith("tropicraft-")),
|
||||
TWILIGHTFOREST("Twilight Forest", false, startsWith("twilightforest")),
|
||||
UBC("Underground Biomes Constructs", false, startsWith("undergroundbiomesconstructs-")),
|
||||
|
||||
Reference in new issue
Block a user