Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #15 from bartimaeusnek/0.4.X
Browse files Browse the repository at this point in the history
removed Taint Biome due to buggyness
  • Loading branch information
bartimaeusnek authored Apr 9, 2019
2 parents 8387b52 + 597a0b2 commit 6128fa4
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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);

}
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit 6128fa4

Please sign in to comment.