Skip to content

Commit

Permalink
Ore Gen Config Entrys
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Sieg committed Dec 16, 2015
1 parent da0a26e commit f3fdcb5
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 23 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@
/.gradle
/.metadata
/.settings
/CameraStudio_log.*
/CameraStudio_log.*
#Nano backup file
/*.save
/*.launch
82 changes: 72 additions & 10 deletions common/net/teamio/taam/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,49 @@ public class Config {

public static Configuration config;

public static boolean genCopper = true;
public static boolean genTin = true;
public static boolean genAluminum = true;
public static boolean genBauxite = true;
public static boolean genKaolinite = true;
// public static boolean genCopper = true;
// public static boolean genTin = true;
// public static boolean genAluminum = true;
// public static boolean genBauxite = true;
// public static boolean genKaolinite = true;

public static final boolean[] genOre = new boolean[]{
true,
true,
true,
true,
true,
};

public static final int[] oreSize = new int[]{
14,
13,
2,
35,
35
};
public static final int[] oreAbove = new int[]{
0,
0,
0,
0,
0
};
public static final int[] oreBelow = new int[]{
64,
64,
64,
128,
100
};
public static final int[] oreDepositCount = new int[]{
7,
7,
3,
10,
5
};

public static boolean debug = false;

public static int sensor_delay = 30;
Expand Down Expand Up @@ -59,12 +97,36 @@ public static void init(File configFile)
private static void loadConfig()
{

genCopper = config.getBoolean("generateCopper", "worldgen", true, Taam.CFG_COMMENT_GEN_COPPER_ORE);
genTin = config.getBoolean("generateTin", "worldgen", true , Taam.CFG_COMMENT_GEN_TIN_ORE);
genAluminum = config.getBoolean("generateAluminum", "worldgen", true , Taam.CFG_COMMENT_GEN_ALUMINUM_ORE);
genBauxite = config.getBoolean("generateBauxite", "worldgen", true , Taam.CFG_COMMENT_GEN_BAUXITE_ORE);
genKaolinite = config.getBoolean("generateKaolinite", "worldgen", true , Taam.CFG_COMMENT_GEN_KAOLINITE_ORE);
genOre[0] = config.getBoolean("generateCopper", "worldgen", true, Taam.CFG_COMMENT_GEN_COPPER_ORE);
genOre[1] = config.getBoolean("generateTin", "worldgen", true , Taam.CFG_COMMENT_GEN_TIN_ORE);
genOre[2]= config.getBoolean("generateAluminum", "worldgen", true , Taam.CFG_COMMENT_GEN_ALUMINUM_ORE);
genOre[3] = config.getBoolean("generateBauxite", "worldgen", true , Taam.CFG_COMMENT_GEN_BAUXITE_ORE);
genOre[4] = config.getBoolean("generateKaolinite", "worldgen", true , Taam.CFG_COMMENT_GEN_KAOLINITE_ORE);

oreSize[0] = config.getInt("oreSize_Copper", "worldgen", 14 , 0, Integer.MAX_VALUE , "");
oreSize[1] = config.getInt("oreSize_Tin", "worldgen", 13 , 0, Integer.MAX_VALUE , "");
oreSize[2] = config.getInt("oreSize_Aluminum", "worldgen", 2 , 0, Integer.MAX_VALUE , "");
oreSize[3] = config.getInt("oreSize_Bauxite", "worldgen", 35 , 0, Integer.MAX_VALUE , "");
oreSize[4] = config.getInt("oreSize_Kaolinite", "worldgen", 35 , 0, Integer.MAX_VALUE , "");

oreAbove[0] = config.getInt("oreAbove_Copper", "worldgen", 0 , 0, 255 , "");
oreAbove[1] = config.getInt("oreAbove_Tin", "worldgen", 0 , 0, 255 , "");
oreAbove[2] = config.getInt("oreAbove_Aluminum", "worldgen", 0 , 0, 255 , "");
oreAbove[3] = config.getInt("oreAbove_Bauxite", "worldgen", 0 , 0, 255 , "");
oreAbove[4] = config.getInt("oreAbove_Kaolinite", "worldgen", 0 , 0, 255 , "");

oreBelow[0] = config.getInt("oreBelow_Copper", "worldgen", 64 , 0, 255 , "");
oreBelow[1] = config.getInt("oreBelow_Tin", "worldgen", 64 , 0, 255 , "");
oreBelow[2] = config.getInt("oreBelow_Aluminum", "worldgen", 64 , 0, 255 , "");
oreBelow[3] = config.getInt("oreBelow_Bauxite", "worldgen", 128 , 0, 255 , "");
oreBelow[4] = config.getInt("oreBelow_Kaolinite", "worldgen", 100 , 0, 255 , "");

oreDepositCount[0] = config.getInt("oreDepositCount_Copper", "worldgen", 64 , 0, Integer.MAX_VALUE , "");
oreDepositCount[1] = config.getInt("oreDepositCount_Tin", "worldgen", 64 , 0, Integer.MAX_VALUE , "");
oreDepositCount[2] = config.getInt("oreDepositCount_Aluminum", "worldgen", 64 , 0, Integer.MAX_VALUE , "");
oreDepositCount[3] = config.getInt("oreDepositCount_Bauxite", "worldgen", 128 , 0, Integer.MAX_VALUE , "");
oreDepositCount[4] = config.getInt("oreDepositCount_Kaolinite", "worldgen", 100 , 0, Integer.MAX_VALUE , "");

debug = config.getBoolean("debug_output", Configuration.CATEGORY_GENERAL, false, Taam.CFG_COMMENT_DEBUG_OUTPUT);

sensor_delay = config.getInt("sensor_delay", "multitronix", 30, 10, 100, Taam.CFG_COMMENT_SENSOR_DELAY);
Expand Down
24 changes: 12 additions & 12 deletions common/net/teamio/taam/OreGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ public GenerationInfo(WorldGenMinable gen, int generateAbove,
public OreGenerator() {
gens = new ArrayList<GenerationInfo>();
// Copper Ore
if(Config.genCopper)
gens.add(new GenerationInfo(new WorldGenMinable(TaamMain.blockOre, Taam.BLOCK_ORE_META.copper.ordinal(), 14, Blocks.stone), 0, 64, 7));
if(Config.genOre[0])
gens.add(new GenerationInfo(new WorldGenMinable(TaamMain.blockOre, Taam.BLOCK_ORE_META.copper.ordinal(), Config.oreSize[0], Blocks.stone), Config.oreAbove[0], Config.oreBelow[0], Config.oreDepositCount[0]));
// Tin Ore
if(Config.genTin)
gens.add(new GenerationInfo(new WorldGenMinable(TaamMain.blockOre, Taam.BLOCK_ORE_META.tin.ordinal(), 13, Blocks.stone), 0, 64, 7));
if(Config.genOre[1])
gens.add(new GenerationInfo(new WorldGenMinable(TaamMain.blockOre, Taam.BLOCK_ORE_META.tin.ordinal(), Config.oreSize[1], Blocks.stone), Config.oreAbove[1], Config.oreBelow[1], Config.oreDepositCount[1]));
// Native Aluminum
if(Config.genAluminum)
gens.add(new GenerationInfo(new WorldGenMinable(TaamMain.blockOre, Taam.BLOCK_ORE_META.aluminum.ordinal(), 2, Blocks.stone), 0, 64, 3));
if(Config.genOre[2])
gens.add(new GenerationInfo(new WorldGenMinable(TaamMain.blockOre, Taam.BLOCK_ORE_META.aluminum.ordinal(), Config.oreSize[2], Blocks.stone), Config.oreAbove[2], Config.oreBelow[2], Config.oreDepositCount[2]));
// Bauxite
if(Config.genBauxite){
gens.add(new GenerationInfo(new WorldGenMinable(TaamMain.blockOre, Taam.BLOCK_ORE_META.bauxite.ordinal(), 35, Blocks.stone), 0, 128, 10));
//gens.add(new GenerationInfo(new WorldGenMinable(TaamMain.blockOre, Taam.BLOCK_ORE_META.bauxite.ordinal(), 35, Blocks.dirt), 0, 128, 5));
if(Config.genOre[3]){
gens.add(new GenerationInfo(new WorldGenMinable(TaamMain.blockOre, Taam.BLOCK_ORE_META.bauxite.ordinal(), Config.oreSize[3], Blocks.stone), Config.oreAbove[3], Config.oreBelow[3], Config.oreDepositCount[3]));
// gens.add(new GenerationInfo(new WorldGenMinable(TaamMain.blockOre, Taam.BLOCK_ORE_META.bauxite.ordinal(), 35, Blocks.dirt), 0, 128, 5));
}
// Kaolinite
if(Config.genKaolinite){
gens.add(new GenerationInfo(new WorldGenMinable(TaamMain.blockOre, Taam.BLOCK_ORE_META.kaolinite.ordinal(), 35, Blocks.stone), 0, 100, 5));
gens.add(new GenerationInfo(new WorldGenMinable(TaamMain.blockOre, Taam.BLOCK_ORE_META.kaolinite.ordinal(), 35, Blocks.dirt), 0, 128, 2));
if(Config.genOre[4]){
gens.add(new GenerationInfo(new WorldGenMinable(TaamMain.blockOre, Taam.BLOCK_ORE_META.kaolinite.ordinal(), Config.oreSize[4], Blocks.stone), Config.oreAbove[4], Config.oreBelow[4], Config.oreDepositCount[4]));
// gens.add(new GenerationInfo(new WorldGenMinable(TaamMain.blockOre, Taam.BLOCK_ORE_META.kaolinite.ordinal(), 35, Blocks.dirt), 0, 128, 2));
}
}

Expand Down
1 change: 1 addition & 0 deletions common/net/teamio/taam/TaamMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ public static void oreRegistration(){
OreDictionary.registerOre("itemRubber", new ItemStack(itemMaterial, 1, Taam.ITEM_MATERIAL_META.rubber_bar.ordinal()));
OreDictionary.registerOre("materialGraphite", new ItemStack(itemMaterial, 1, Taam.ITEM_MATERIAL_META.graphite.ordinal()));
OreDictionary.registerOre("materialSiliconWafer", new ItemStack(itemMaterial, 1, Taam.ITEM_MATERIAL_META.silicon_wafer.ordinal()));
OreDictionary.registerOre("materialResin", new ItemStack(itemMaterial, 1, Taam.ITEM_MATERIAL_META.resin.ordinal()));

OreDictionary.registerOre("partPhotocell", new ItemStack(itemPart, 1, Taam.ITEM_PART_META.photocell.ordinal()));
OreDictionary.registerOre("partMotor", new ItemStack(itemPart, 1, Taam.ITEM_PART_META.motor.ordinal()));
Expand Down

0 comments on commit f3fdcb5

Please sign in to comment.