Added feature control

This commit is contained in:
oitsjustjose 2016-01-28 15:43:24 -05:00
commit 9662faeee7
4 changed files with 94 additions and 20 deletions

View file

@ -29,6 +29,7 @@ public class ConfigGUI extends GuiConfig
list.add(new ConfigElement(Config.Electroextractor));
list.add(new ConfigElement(Config.Woodchipper));
list.add(new ConfigElement(Config.OtherMachines));
list.add(new ConfigElement(Config.FeatureControl));
return list;
}

View file

@ -21,6 +21,7 @@ public class Config
public static ConfigCategory Electroextractor;
public static ConfigCategory Woodchipper;
public static ConfigCategory OtherMachines;
public static ConfigCategory FeatureControl;
// Cropomator Configs
public static int cropomatorProcessTime;
public static int cropomatorOutput;
@ -41,11 +42,22 @@ public class Config
public static int woodchipperProcessTime;
public static int woodchipperOutput;
public static String woodchipperRecipeItem;
// Scribe Configs
// Scribe Configs
public static String[] scribeRecipes;
public static String[] defaultScribeRecipes = new String[] { "minecraft:fish:3*16=6", "minecraft:spider_eye:0*8=18", "minecraft:obsidian:0*8=3", "minecraft:prismarine_shard:0*16=8", "minecraft:feather:0*32=2", "minecraft:blaze_rod:0*8=20", "minecraft:blaze_powder:0*16=50", "minecraft:piston:0*4=19", "minecraft:prismarine_crystals:0*16=61", "minecraft:fish:0*16=62", "minecraft:potion:8269*1=5", "minecraft:slime:0*8=33", "minecraft:rotten_flesh:0*48=17", "minecraft:double_plant:4*64=7", "ingotIron*24=34", "ingotGold*12=49", "gemQuartz*16=48", "gemDiamond*8=51", "gemEmerald*3=21", "logWood*16=4", "blockIron*4=0", "blockQuartz*16=16", "blockLapis*12=35", "blockRedstone*8=32" };
// Block Generator Configs (stone and cobble)
public static int blockGeneratorProcessTimes;
// Feature enabler
public static boolean enableCropomator;
public static boolean enableElectroextractor;
public static boolean enableWoodchipper;
public static boolean enableCobblestoneGenerator;
public static boolean enableStoneGenerator;
public static boolean enableScribe;
public static boolean enablePouches;
public static boolean enableMantlesmashers;
public static boolean enableInfiniapple;
public static boolean enableBuckets;
public static void init(File configFile)
{
@ -156,6 +168,55 @@ public class Config
OtherMachines.setPropertyOrder(propertyOrder);
// Feature Control
category = "feature control";
propertyOrder = Lists.newArrayList();
FeatureControl = config.getCategory(category);
config.setCategoryRequiresMcRestart(category, true);
config.setCategoryComment(category, "Enable / Disable Features");
property = config.get(category, "Cropomator", true);
enableCropomator = property.getBoolean();
propertyOrder.add(property.getName());
property = config.get(category, "Electroextractor", true);
enableElectroextractor = property.getBoolean();
propertyOrder.add(property.getName());
property = config.get(category, "Woodchipper", true);
enableWoodchipper = property.getBoolean();
propertyOrder.add(property.getName());
property = config.get(category, "Cobblestone Generator", true);
enableCobblestoneGenerator = property.getBoolean();
propertyOrder.add(property.getName());
property = config.get(category, "Stone Generator", true);
enableStoneGenerator = property.getBoolean();
propertyOrder.add(property.getName());
property = config.get(category, "Scribe", true);
enableScribe = property.getBoolean();
propertyOrder.add(property.getName());
property = config.get(category, "Pouches", true);
enablePouches = property.getBoolean();
propertyOrder.add(property.getName());
property = config.get(category, "Mantle Smashers", true);
enableMantlesmashers = property.getBoolean();
propertyOrder.add(property.getName());
property = config.get(category, "Infiniapple", true);
enableInfiniapple = property.getBoolean();
propertyOrder.add(property.getName());
property = config.get(category, "Special Buckets", true);
enableBuckets = property.getBoolean();
propertyOrder.add(property.getName());
FeatureControl.setPropertyOrder(propertyOrder);
if (config.hasChanged())
config.save();

View file

@ -21,12 +21,17 @@ public class LibBlocks
public static void init()
{
cropomator = new BlockCropomator();
electroextractor = new BlockElectroextractor();
woodchipper = new BlockWoodchipper();
cobblegen = new BlockCobblegen();
stonegen = new BlockStonegen();
scribe = new BlockScribe();
// TODO: atmosManipulator = new BlockAtmosManipulator();
if (Config.enableCropomator)
cropomator = new BlockCropomator();
if (Config.enableElectroextractor)
electroextractor = new BlockElectroextractor();
if (Config.enableWoodchipper)
woodchipper = new BlockWoodchipper();
if (Config.enableCobblestoneGenerator)
cobblegen = new BlockCobblegen();
if (Config.enableStoneGenerator)
stonegen = new BlockStonegen();
if (Config.enableScribe)
scribe = new BlockScribe();
}
}

View file

@ -29,18 +29,25 @@ public class LibItems
public static void init()
{
mkI = EnumHelper.addToolMaterial("mkI", 7, 6244, 8.0F, -2.0F, 10);
mkI.setRepairItem(new ItemStack(Blocks.emerald_block));
mkII = EnumHelper.addToolMaterial("mkII", 10, -1, 12.0F, -2.0F, 32);
if (Config.enableMantlesmashers)
{
mkI = EnumHelper.addToolMaterial("mkI", 7, 6244, 8.0F, -2.0F, 10);
mkI.setRepairItem(new ItemStack(Blocks.emerald_block));
mkII = EnumHelper.addToolMaterial("mkII", 10, -1, 12.0F, -2.0F, 32);
dusts = new ItemDust();
buckets = new ItemModBuckets();
infiniApple = new ItemInfiniApple();
pouch = new ItemPouch();
mantleSmasherMkI = new ItemMantleSmasher(mkI);
mantleSmasherMkII = new ItemMantleSmasher(mkII);
FluidContainerRegistry.registerFluidContainer(new FluidStack(FluidRegistry.WATER, 4000), new ItemStack(buckets, 1, 0), new ItemStack(buckets, 1, 0));
mantleSmasherMkI = new ItemMantleSmasher(mkI);
mantleSmasherMkII = new ItemMantleSmasher(mkII);
}
if (Config.enableElectroextractor)
dusts = new ItemDust();
if (Config.enableBuckets)
{
buckets = new ItemModBuckets();
FluidContainerRegistry.registerFluidContainer(new FluidStack(FluidRegistry.WATER, 4000), new ItemStack(buckets, 1, 0), new ItemStack(buckets, 1, 0));
}
if (Config.enableInfiniapple)
infiniApple = new ItemInfiniApple();
if (Config.enablePouches)
pouch = new ItemPouch();
}
}