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

Commit

Permalink
Added config options
Browse files Browse the repository at this point in the history
-removed broken IC2 recipes

Signed-off-by: bartimaeusnek <[email protected]>
  • Loading branch information
bartimaeusnek committed Jun 2, 2019
1 parent 0f6ddc8 commit 95acba2
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 40 deletions.
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
mc_version=1.7.10
majorUpdate=0
minorUpdate=4
buildNumber=15
buildNumber=16
APIVersion=6
ic2.version=2.2.828-experimental
gregtech.version=5.09.32.36
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import com.github.bartimaeusnek.bartworks.API.API_REFERENCE;
import com.github.bartimaeusnek.bartworks.API.BioObjectAdder;
import com.github.bartimaeusnek.bartworks.client.ClientEventHandler.ClientEventHandler;
import com.github.bartimaeusnek.bartworks.client.ClientEventHandler.TooltipEventHandler;
import com.github.bartimaeusnek.bartworks.client.creativetabs.BioTab;
import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab;
import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab;
Expand Down Expand Up @@ -128,8 +128,8 @@ public void preInit(FMLPreInitializationEvent preinit) {

@Mod.EventHandler
public void init(FMLInitializationEvent init) {
if (FMLCommonHandler.instance().getSide().isClient() && ConfigHandler.BioLab)
MinecraftForge.EVENT_BUS.register(new ClientEventHandler());
if (FMLCommonHandler.instance().getSide().isClient() && ConfigHandler.tooltips)
MinecraftForge.EVENT_BUS.register(new TooltipEventHandler());
if (FMLCommonHandler.instance().getSide().isServer())
MinecraftForge.EVENT_BUS.register(new ServerEventHandler());
new LoaderRegistry().run();
Expand All @@ -141,7 +141,6 @@ public void init(FMLInitializationEvent init) {
else
WerkstoffLoader.INSTANCE.runInit();
}

}

@Mod.EventHandler
Expand All @@ -160,6 +159,7 @@ public void postInit(FMLPostInitializationEvent postinit) {
@Mod.EventHandler
public void onServerStarted(FMLServerStartedEvent event) {
OreDictHandler.adaptCacheForWorld();
WerkstoffLoader.removeIC2Recipes();
if (eicMap == null) {
eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true);
recipeLoop:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@
import java.util.List;

@SideOnly(Side.CLIENT)
public class ClientEventHandler {
public class TooltipEventHandler {

@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void getTooltip(ItemTooltipEvent event) {

if (event.itemStack == null || event.itemStack.getItem() == null)
if (event == null || event.itemStack == null || event.itemStack.getItem() == null)
return;

if (TooltipCache.getTooltip(event.itemStack).isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,42 @@
import java.util.Arrays;

public class ConfigHandler {

private static final int IDU = 10 * 8 + 5;
public static int IDOffset = 12600;
public static boolean teslastaff;
public static long energyPerCell = 1000000L;
public static boolean newStuff = true;
public static boolean BioLab = true;
public static Configuration c;
public static boolean DEHPDirectSteam;

public static int IDOffset = 12600;
public static int megaMachinesMax = 256;
public static int mbWaterperSec = 150;
public static int ross128BID = -64;
public static int ross128BAID = -63;
public static int ross128btier = 3;
public static int ross128batier = 3;
public static int landerType = 3;
public static int ross128bRuinChance = 512;

public static long energyPerCell = 1000000L;

public static boolean newStuff = true;
public static boolean BioLab = true;
public static boolean Ross128Enabled = true;
public static boolean debugLog;

public static boolean DEHPDirectSteam;
public static boolean teslastaff;
public static boolean experimentalThreadedLoader;
public static boolean GTNH;
public static boolean ezmode;
public static boolean[] enabledPatches ;

//One-Side-Only
public static boolean debugLog;
public static boolean tooltips = true;
public static boolean[] enabledPatches;


public ConfigHandler(Configuration C) {
ConfigHandler.c = C;

ConfigHandler.tooltips = ConfigHandler.c.get("System", "BartWorksToolTips", true, "If you wish to enable extra tooltips").getBoolean(true);
ConfigHandler.IDOffset = ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600);
ConfigHandler.energyPerCell = ConfigHandler.c.get("Multiblocks", "energyPerLESUCell", 1000000, "This will set Up the Energy per LESU Cell", 1000000, Integer.MAX_VALUE).getInt(1000000);
ConfigHandler.ezmode = ConfigHandler.c.get("System", "Mode switch", false, "If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.").getBoolean(false);
Expand All @@ -74,9 +89,11 @@ public ConfigHandler(Configuration C) {

ConfigHandler.ross128BID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64);
ConfigHandler.ross128BAID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128ba", -63, "The Dim ID for Ross128ba (Ross128b's Moon)").getInt(-63);

ConfigHandler.ross128btier = ConfigHandler.c.get("CrossMod Interactions", "Rocket Tier - Ross128b", 3, "The Rocket Tier for Ross128b").getInt(3);
ConfigHandler.ross128batier = ConfigHandler.c.get("CrossMod Interactions", "Rocket Tier - Ross128ba", 3, "The Rocket Tier for Ross128a").getInt(3);
ConfigHandler.ross128bRuinChance = ConfigHandler.c.get("CrossMod Interactions", "Ruin Chance - Ross128b", 512, "Higher Values mean lesser Ruins.").getInt(512);
ConfigHandler.Ross128Enabled = ConfigHandler.c.get("CrossMod Interactions", "Galacticraft - Activate Ross128 System", true, "If the Ross128 System should be activated").getBoolean(true);

ConfigHandler.landerType = ConfigHandler.c.get("CrossMod Interactions", "LanderType", 3, "1 = Moon Lander, 2 = Landing Balloons, 3 = Asteroid Lander").getInt(3);
ConfigHandler.setUpComments();

if (ConfigHandler.c.hasChanged())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,19 @@
import gregtech.api.objects.GT_MultiTexture;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.objects.ItemData;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.*;
import ic2.api.recipe.IRecipeInput;
import ic2.api.recipe.RecipeInputOreDict;
import ic2.api.recipe.RecipeOutput;
import ic2.api.recipe.Recipes;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.*;

import static gregtech.api.enums.OrePrefixes.*;

Expand Down Expand Up @@ -608,12 +607,32 @@ public void gameRegistryHandler(){
GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE");
WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores");
GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.01");
runGTItemDataRegistrator();
}

public static void runGTItemDataRegistrator(){
for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) {
if (werkstoff.getGenerationFeatures().hasOres())
GT_OreDictUnificator.setItemData(new ItemStack(WerkstoffLoader.BWOres,1,werkstoff.getmID()), new ItemData(ore,Materials._NULL));
}
}

public static void removeIC2Recipes() {
try {
Set<Map.Entry<IRecipeInput, RecipeOutput>> remset = new HashSet<>();
for (Map.Entry<IRecipeInput, RecipeOutput> curr : Recipes.macerator.getRecipes().entrySet()) {
if (curr.getKey() instanceof RecipeInputOreDict) {
if (((RecipeInputOreDict) curr.getKey()).input.equalsIgnoreCase("oreNULL")) {
remset.add(curr);
}
}
}
Recipes.macerator.getRecipes().entrySet().removeAll(remset);
}catch (Exception e){
e.printStackTrace();
}
}

private void runAdditionalOreDict(){
if (ConfigHandler.experimentalThreadedLoader){
for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
import net.minecraftforge.fluids.FluidRegistry;

import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList;

import static gregtech.api.enums.Materials.*;
import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*;

public class BW_WorldGenRoss128b extends BW_OreLayer {

Expand All @@ -46,16 +47,16 @@ public BW_WorldGenRoss128b(String aName, boolean aDefault, int aMinY, int aMaxY,
}

public static void init_OresRoss128() {
new BW_WorldGenRoss128b("ore.mix.ross128.Thorianit", true, 30, 60, 17, 1, 16, WerkstoffLoader.Thorianit, Materials.Uraninite, Materials.Lepidolite, Materials.Spodumene);
new BW_WorldGenRoss128b("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Materials.Graphite, Materials.Diamond, Materials.Coal, Materials.Graphite);
new BW_WorldGenRoss128b("ore.mix.ross128.bismuth", true, 5, 80, 30, 1, 16, WerkstoffLoader.Bismuthinit, Materials.Stibnite, Materials.Bismuth, WerkstoffLoader.Bismutite);
new BW_WorldGenRoss128b("ore.mix.ross128.TurmalinAlkali", true, 5, 80, 15, 4, 48, WerkstoffLoader.Olenit, WerkstoffLoader.FluorBuergerit, WerkstoffLoader.ChromoAluminoPovondrait, WerkstoffLoader.VanadioOxyDravit);
new BW_WorldGenRoss128b("ore.mix.ross128.Roquesit", true, 30, 50, 3, 1, 12, WerkstoffLoader.Arsenopyrite, WerkstoffLoader.Ferberite, WerkstoffLoader.Loellingit, WerkstoffLoader.Roquesit);
new BW_WorldGenRoss128b("ore.mix.ross128.Tungstate", true, 5, 40, 10, 4, 14, WerkstoffLoader.Ferberite, WerkstoffLoader.Huebnerit, WerkstoffLoader.Loellingit, Materials.Scheelite);
new BW_WorldGenRoss128b("ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, WerkstoffLoader.Djurleit, WerkstoffLoader.Bornite, WerkstoffLoader.Wittichenit, Materials.Tetrahedrite);
new BW_WorldGenRoss128b("ore.mix.ross128.Forsterit", true, 20, 90, 50, 2, 32, WerkstoffLoader.Forsterit, WerkstoffLoader.Fayalit, WerkstoffLoader.DescloiziteCUVO4, WerkstoffLoader.DescloiziteZNVO4);
new BW_WorldGenRoss128b("ore.mix.ross128.Hedenbergit", true, 20, 90, 50, 2, 32, WerkstoffLoader.Hedenbergit, WerkstoffLoader.Fayalit, WerkstoffLoader.DescloiziteCUVO4, WerkstoffLoader.DescloiziteZNVO4);
new BW_WorldGenRoss128b("ore.mix.ross128.RedZircon", true, 10, 80, 40, 3, 24, WerkstoffLoader.Fayalit,WerkstoffLoader.FuchsitAL , WerkstoffLoader.RedZircon,WerkstoffLoader.FuchsitCR);
new BW_WorldGenRoss128b("ore.mix.ross128.Thorianit", true, 30, 60, 17, 1, 16, Thorianit, Uraninite, Lepidolite, Spodumene);
new BW_WorldGenRoss128b("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Graphite, Diamond, Coal, Graphite);
new BW_WorldGenRoss128b("ore.mix.ross128.bismuth", true, 5, 80, 30, 1, 16, Bismuthinit, Stibnite, Bismuth, Bismutite);
new BW_WorldGenRoss128b("ore.mix.ross128.TurmalinAlkali", true, 5, 80, 15, 4, 48, Olenit, FluorBuergerit, ChromoAluminoPovondrait, VanadioOxyDravit);
new BW_WorldGenRoss128b("ore.mix.ross128.Roquesit", true, 30, 50, 3, 1, 12, Arsenopyrite, Ferberite, Loellingit, Roquesit);
new BW_WorldGenRoss128b("ore.mix.ross128.Tungstate", true, 5, 40, 10, 4, 14, Ferberite, Huebnerit, Loellingit, Scheelite);
new BW_WorldGenRoss128b("ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, Djurleit, Bornite, Wittichenit, Tetrahedrite);
new BW_WorldGenRoss128b("ore.mix.ross128.Forsterit", true, 20, 90, 50, 2, 32, Forsterit, Fayalit, DescloiziteCUVO4, DescloiziteZNVO4);
new BW_WorldGenRoss128b("ore.mix.ross128.Hedenbergit", true, 20, 90, 50, 2, 32, Hedenbergit, Fayalit, DescloiziteCUVO4, DescloiziteZNVO4);
new BW_WorldGenRoss128b("ore.mix.ross128.RedZircon", true, 10, 80, 40, 3, 24, Fayalit,FuchsitAL , RedZircon,FuchsitCR);
}

public static void init_undergroundFluidsRoss128() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@

package com.github.bartimaeusnek.crossmod.galacticraft;

import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import micdoodle8.mods.galacticraft.api.vector.Vector3;
import micdoodle8.mods.galacticraft.api.world.ITeleportType;
import micdoodle8.mods.galacticraft.core.entities.EntityLander;
import micdoodle8.mods.galacticraft.core.entities.EntityLanderBase;
import micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats;
import micdoodle8.mods.galacticraft.planets.asteroids.entities.EntityEntryPod;
import micdoodle8.mods.galacticraft.planets.mars.entities.EntityLandingBalloons;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
Expand Down Expand Up @@ -66,9 +70,22 @@ public void onSpaceDimensionChanged(World newWorld, EntityPlayerMP player, boole
player.capabilities.isFlying = false;
}

EntityLandingBalloons entityLandingBalloons = new EntityLandingBalloons(player);
EntityLanderBase elb;

switch (ConfigHandler.landerType){
case 1:
elb = new EntityLander(player);
break;
case 2:
elb = new EntityLandingBalloons(player);
break;
default:
elb = new EntityEntryPod(player);
break;
}

if (!newWorld.isRemote) {
newWorld.spawnEntityInWorld(entityLandingBalloons);
newWorld.spawnEntityInWorld(elb);
}
GCPlayerStats.get(player).teleportCooldown = 10;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b;

import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import com.github.bartimaeusnek.bartworks.system.oregen.BW_WordGenerator;
import com.github.bartimaeusnek.bartworks.system.worldgen.MapGenRuins;
import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler;
Expand Down Expand Up @@ -121,7 +122,7 @@ public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_)
int z1;

if (biomegenbase != BiomeGenBase.ocean && biomegenbase != BiomeGenBase.deepOcean && biomegenbase != BiomeGenBase.river && biomegenbase != BiomeGenBase.frozenOcean && biomegenbase != BiomeGenBase.frozenRiver
&& this.rand.nextInt(512) == 0) {
&& this.rand.nextInt(ConfigHandler.ross128bRuinChance) == 0) {
x1 = k + this.rand.nextInt(16) + 3;
y1 = this.rand.nextInt(256);
z1 = l + this.rand.nextInt(16) + 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static void init() {
Ross128SolarSystem.Ross128b.setRelativeOrbitTime(0.65F);
Ross128SolarSystem.Ross128b.atmosphere.addAll(Arrays.asList(IAtmosphericGas.OXYGEN, IAtmosphericGas.NITROGEN, IAtmosphericGas.ARGON));
Ross128SolarSystem.Ross128b.setDimensionInfo(ConfigHandler.ross128BID, WorldProviderRoss128b.class);
Ross128SolarSystem.Ross128b.setTierRequired(3);
Ross128SolarSystem.Ross128b.setTierRequired(ConfigHandler.ross128btier);

Ross128SolarSystem.Ross128ba = new Moon("Ross128ba").setParentPlanet(Ross128SolarSystem.Ross128b);
Ross128SolarSystem.Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)).setRelativeOrbitTime(1 / 0.01F);
Expand Down

0 comments on commit 95acba2

Please sign in to comment.