diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 9cefea1a7..cd420afdc 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.crossmod; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; +import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -48,11 +49,10 @@ public class BartWorksCrossmod { @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { - - if (Loader.isModLoaded("GalacticraftCore")) GalacticraftProxy.preInit(preinit); - + if (Loader.isModLoaded("Thaumcraft")) + new CustomAspects(); } @Mod.EventHandler diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java index 0476e4356..956810dd7 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java @@ -23,6 +23,8 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_WordGenerator; +import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; +import cpw.mods.fml.common.Loader; import gregtech.api.objects.XSTR; import net.minecraft.block.Block; import net.minecraft.block.BlockFalling; @@ -77,6 +79,10 @@ public Chunk provideChunk(int p_73154_1_, int p_73154_2_) { } else if (biomeGenBase.biomeID == BiomeGenBase.mushroomIslandShore.biomeID) { this.biomesForGeneration[i] = BiomeGenBase.stoneBeach; } + if (Loader.isModLoaded("Thaumcraft")) { + if (ThaumcraftHandler.isTaintBiome(biomeGenBase.biomeID)) + this.biomesForGeneration[i] = BiomeGenBase.taiga; + } } this.replaceBlocksForBiome(p_73154_1_, p_73154_2_, ablock, abyte, this.biomesForGeneration); this.caveGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java new file mode 100644 index 000000000..bb419228d --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.thaumcraft; + +//import com.github.bartimaeusnek.bartworks.MainMod; +//import net.minecraft.util.ResourceLocation; +//import thaumcraft.api.aspects.Aspect; +// +//import static thaumcraft.api.aspects.Aspect.*; + +public class CustomAspects { +// final static Aspect TRADE = new Aspect("Artis",0x00FF00,new Aspect[]{EXCHANGE, MAN},new ResourceLocation(MainMod.MOD_ID+":Aspects/Artis.png"),1); +// final static Aspect UNIVERSE = new Aspect("Universum",0x0000FF,new Aspect[]{MAGIC, ELDRITCH},new ResourceLocation(MainMod.MOD_ID+":Aspects/Universum.png"),1); +// final static Aspect SCIENCE = new Aspect("Scientia",0x00FFFF,new Aspect[]{MAN, UNIVERSE},new ResourceLocation(MainMod.MOD_ID+":Aspects/Scientia.png"),1); + +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java new file mode 100644 index 000000000..a3cc19b41 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.thaumcraft.util; + +import net.minecraft.world.biome.BiomeGenBase; + +public class ThaumcraftHandler { + private ThaumcraftHandler(){} + + public static Integer taintBiomeID = null; + + public static boolean isTaintBiome(int biomeID){ + if (taintBiomeID == null) { + try { + BiomeGenBase TaintBiome = (BiomeGenBase) Class.forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator").getField("biomeTaint").get(null); + return biomeID == (taintBiomeID = TaintBiome.biomeID); + } catch (ClassCastException | ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { + e.printStackTrace(); + return false; + } + } + return biomeID == taintBiomeID; + } +}