Skip to content

Commit

Permalink
remove dropBrokenBlocks option (was mostly dummy), add markerRange co…
Browse files Browse the repository at this point in the history
…nfig (currently capped at 64)
  • Loading branch information
asiekierka committed Feb 26, 2015
1 parent 78f8a05 commit 2f744f1
Show file tree
Hide file tree
Showing 13 changed files with 93 additions and 84 deletions.
9 changes: 9 additions & 0 deletions common/buildcraft/BuildCraftBuilders.java
Expand Up @@ -167,6 +167,7 @@ public class BuildCraftBuilders extends BuildCraftMod {
public static BlueprintDatabase clientDB;

public static boolean debugPrintSchematicList = false;
public static boolean dropBrokenBlocks = false;

@Mod.EventHandler
public void loadConfiguration(FMLPreInitializationEvent evt) {
Expand Down Expand Up @@ -197,6 +198,14 @@ public void loadConfiguration(FMLPreInitializationEvent evt) {
for (int i = 0; i < blueprintLibraryInput.length; ++i) {
blueprintLibraryInput[i] = JavaTools.stripSurroundingQuotes(replacePathVariables(blueprintLibraryInput[i]));
}

//Property dropBlock = BuildCraftCore.mainConfiguration.get("general", "builder.dropBrokenBlocks", false, "set to true to force the builder to drop broken blocks");
//dropBrokenBlocks = dropBlock.getBoolean(false);

Property markerRange = BuildCraftCore.mainConfiguration.get("general", "marker.range", 64, "Set the default marker range. Setting it too high might cause lag and general weirdness, so watch out!");
markerRange.setMinValue(8);
markerRange.setMaxValue(64);
DefaultProps.MARKER_RANGE = markerRange.getInt();

Property printSchematicList = BuildCraftCore.mainConfiguration.get("debug", "blueprints.printSchematicList", false);
debugPrintSchematicList = printSchematicList.getBoolean();
Expand Down
23 changes: 9 additions & 14 deletions common/buildcraft/BuildCraftCore.java
Expand Up @@ -201,7 +201,6 @@ public static enum RenderMode {
public static boolean debugWorldgen = false;
public static boolean modifyWorld = false;
public static boolean colorBlindMode = false;
public static boolean dropBrokenBlocks = true; // Set to false to prevent the filler from dropping broken blocks.
public static boolean hidePowerNumbers = false;
public static boolean hideFluidNumbers = false;
public static int itemLifespan = 1200;
Expand Down Expand Up @@ -314,36 +313,32 @@ public void loadConfiguration(FMLPreInitializationEvent evt) {
try {
mainConfiguration.load();

Property updateCheck = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "update.check", true);
Property updateCheck = BuildCraftCore.mainConfiguration.get("general", "update.check", true);
updateCheck.comment = "set to true for version check on startup";
if (updateCheck.getBoolean(true)) {
Version.check();
}

Property dropBlock = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "dropBrokenBlocks", true);
dropBlock.comment = "set to false to prevent fillers from dropping blocks.";
dropBrokenBlocks = dropBlock.getBoolean(true);

Property hideRFNumbers = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "hidePowerNumbers", false);
Property hideRFNumbers = BuildCraftCore.mainConfiguration.get("general", "hidePowerNumbers", false);
hideRFNumbers.comment = "set to true to not display any RF or RF/t numbers.";
hidePowerNumbers = hideRFNumbers.getBoolean(false);

Property hideMBNumbers = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "hideFluidNumbers", false);
Property hideMBNumbers = BuildCraftCore.mainConfiguration.get("general", "hideFluidNumbers", false);
hideMBNumbers.comment = "set to true to not display any mB or mB/t numbers.";
hideFluidNumbers = hideMBNumbers.getBoolean(false);

Property lifespan = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "itemLifespan", itemLifespan);
Property lifespan = BuildCraftCore.mainConfiguration.get("general", "itemLifespan", itemLifespan);
lifespan.comment = "the lifespan in ticks of items dropped on the ground by pipes and machines, vanilla = 6000, default = 1200";
itemLifespan = lifespan.getInt(itemLifespan);
if (itemLifespan < 100) {
itemLifespan = 100;
}

Property factor = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "network.updateFactor", 10);
Property factor = BuildCraftCore.mainConfiguration.get("general", "network.updateFactor", 10);
factor.comment = "increasing this number will decrease network update frequency, useful for overloaded servers";
updateFactor = factor.getInt(10);

Property longFactor = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "network.stateRefreshPeriod", 40);
Property longFactor = BuildCraftCore.mainConfiguration.get("general", "network.stateRefreshPeriod", 40);
longFactor.comment = "delay between full client sync packets, increasing it saves bandwidth, decreasing makes for better client syncronization.";
longUpdateFactor = longFactor.getInt(40);

Expand All @@ -356,7 +351,7 @@ public void loadConfiguration(FMLPreInitializationEvent evt) {
listItem = (new ItemList()).setUnlocalizedName("list");
CoreProxy.proxy.registerItem(listItem);

Property modifyWorldProp = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "modifyWorld", true);
Property modifyWorldProp = BuildCraftCore.mainConfiguration.get("general", "modifyWorld", true);
modifyWorldProp.comment = "set to false if BuildCraft should not generate custom blocks (e.g. oil)";
modifyWorld = modifyWorldProp.getBoolean(true);

Expand All @@ -366,7 +361,7 @@ public void loadConfiguration(FMLPreInitializationEvent evt) {
CoreProxy.proxy.registerBlock(springBlock, ItemSpring.class);
}

Property consumeWater = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "consumeWater", consumeWaterSources);
Property consumeWater = BuildCraftCore.mainConfiguration.get("general", "consumeWater", consumeWaterSources);
consumeWaterSources = consumeWater.getBoolean(consumeWaterSources);
consumeWater.comment = "set to true if the Pump should consume water";

Expand Down Expand Up @@ -481,7 +476,7 @@ public void init(FMLInitializationEvent evt) {
MinecraftForge.EVENT_BUS.register(new SpringPopulate());
}

for (String l : BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL,
for (String l : BuildCraftCore.mainConfiguration.get("general",
"recipesBlacklist", new String[0]).getStringList()) {
recipesBlacklist.add(JavaTools.stripSurroundingQuotes(l.trim()));
}
Expand Down
26 changes: 13 additions & 13 deletions common/buildcraft/BuildCraftEnergy.java
Expand Up @@ -120,39 +120,39 @@ public class BuildCraftEnergy extends BuildCraftMod {
public void preInit(FMLPreInitializationEvent evt) {
int oilDesertBiomeId = BuildCraftCore.mainConfiguration.get("biomes", "biomeOilDesert", DefaultProps.BIOME_OIL_DESERT).getInt(DefaultProps.BIOME_OIL_DESERT);
int oilOceanBiomeId = BuildCraftCore.mainConfiguration.get("biomes", "biomeOilOcean", DefaultProps.BIOME_OIL_OCEAN).getInt(DefaultProps.BIOME_OIL_OCEAN);
canOilBurn = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "burnOil", true, "Can oil burn?").getBoolean(true);
isOilDense = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "denseOil", true, "Should it be hard to swim in oil?").getBoolean(true);
oilWellScalar = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "oilWellGenerationRate", 1.0, "Probability of oil well generation").getDouble(1.0);
canEnginesExplode = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "enginesExplode", false, "Do engines explode upon overheat?").getBoolean(false);
canOilBurn = BuildCraftCore.mainConfiguration.get("general", "burnOil", true, "Can oil burn?").getBoolean(true);
isOilDense = BuildCraftCore.mainConfiguration.get("general", "denseOil", true, "Should it be hard to swim in oil?").getBoolean(true);
oilWellScalar = BuildCraftCore.mainConfiguration.get("general", "oilWellGenerationRate", 1.0, "Probability of oil well generation").getDouble(1.0);
canEnginesExplode = BuildCraftCore.mainConfiguration.get("general", "enginesExplode", false, "Do engines explode upon overheat?").getBoolean(false);

setBiomeList(
OilPopulate.INSTANCE.surfaceDepositBiomes,
BuildCraftCore.mainConfiguration
.get(Configuration.CATEGORY_GENERAL, "oil.increasedBiomeIDs",
.get("general", "oil.increasedBiomeIDs",
new String[] {BiomeDictionary.Type.SANDY.toString(), BiomeGenBase.taiga.biomeName},
"IDs or Biome Types (e.g. SANDY,OCEAN) of biomes that should have increased oil generation rates."));

setBiomeList(
OilPopulate.INSTANCE.excessiveBiomes,
BuildCraftCore.mainConfiguration
.get(Configuration.CATEGORY_GENERAL,
.get("general",
"oil.excessiveBiomeIDs",
new String[] {},
"IDs or Biome Types (e.g. SANDY,OCEAN) of biomes that should have GREATLY increased oil generation rates."));

setBiomeList(OilPopulate.INSTANCE.excludedBiomes,
BuildCraftCore.mainConfiguration
.get(Configuration.CATEGORY_GENERAL, "oil.excludeBiomeIDs",
.get("general", "oil.excludeBiomeIDs",
new String[] {BiomeGenBase.sky.biomeName, BiomeGenBase.hell.biomeName},
"IDs or Biome Types (e.g. SANDY,OCEAN) of biomes that are excluded from generating oil."));

double fuelLavaMultiplier = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.lava.combustion", 1.0F, "adjust energy value of Lava in Combustion Engines").getDouble(1.0F);
double fuelOilMultiplier = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.oil.combustion", 1.0F, "adjust energy value of Oil in Combustion Engines").getDouble(1.0F);
double fuelFuelMultiplier = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.fuel.combustion", 1.0F, "adjust energy value of Fuel in Combustion Engines").getDouble(1.0F);
double fuelLavaMultiplier = BuildCraftCore.mainConfiguration.get("general", "fuel.lava.combustion", 1.0F, "adjust energy value of Lava in Combustion Engines").getDouble(1.0F);
double fuelOilMultiplier = BuildCraftCore.mainConfiguration.get("general", "fuel.oil.combustion", 1.0F, "adjust energy value of Oil in Combustion Engines").getDouble(1.0F);
double fuelFuelMultiplier = BuildCraftCore.mainConfiguration.get("general", "fuel.fuel.combustion", 1.0F, "adjust energy value of Fuel in Combustion Engines").getDouble(1.0F);

int fuelLavaEnergyOutput = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.lava.combustion.energyOutput", 20, "adjust output energy by Lava in Combustion Engines").getInt(20);
int fuelOilEnergyOutput = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.oil.combustion.energyOutput", 30, "adjust output energy by Oil in Combustion Engines").getInt(30);
int fuelFuelEnergyOutput = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.fuel.combustion.energyOutput", 60, "adjust output energy by Fuel in Combustion Engines").getInt(60);
int fuelLavaEnergyOutput = BuildCraftCore.mainConfiguration.get("general", "fuel.lava.combustion.energyOutput", 20, "adjust output energy by Lava in Combustion Engines").getInt(20);
int fuelOilEnergyOutput = BuildCraftCore.mainConfiguration.get("general", "fuel.oil.combustion.energyOutput", 30, "adjust output energy by Oil in Combustion Engines").getInt(30);
int fuelFuelEnergyOutput = BuildCraftCore.mainConfiguration.get("general", "fuel.fuel.combustion.energyOutput", 60, "adjust output energy by Fuel in Combustion Engines").getInt(60);

BuildCraftCore.mainConfiguration.save();

Expand Down
4 changes: 2 additions & 2 deletions common/buildcraft/BuildCraftFactory.java
Expand Up @@ -176,15 +176,15 @@ public void initialize(FMLPreInitializationEvent evt) {
channels = NetworkRegistry.INSTANCE.newChannel
(DefaultProps.NET_CHANNEL_NAME + "-FACTORY", new BuildCraftChannelHandler(), new PacketHandlerFactory());

ConfigUtils genCat = new ConfigUtils(BuildCraftCore.mainConfiguration, Configuration.CATEGORY_GENERAL);
ConfigUtils genCat = new ConfigUtils(BuildCraftCore.mainConfiguration, "general");

allowMining = genCat.get("mining.enabled", true, "disables the recipes for automated mining machines");
quarryOneTimeUse = genCat.get("quarry.one.time.use", false, "Quarry cannot be picked back up after placement");
miningMultiplier = genCat.get("mining.cost.multipler", 1F, 1F, 10F, "cost multiplier for mining operations, range (1.0 - 10.0)\nhigh values may render engines incapable of powering machines directly");
miningDepth = genCat.get("mining.depth", 2, 256, 256, "how far below the machine can mining machines dig, range (2 - 256), default 256");
quarryLoadsChunks = genCat.get("quarry.loads.chunks", true, "Quarry loads chunks required for mining");

Property pumpList = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "pumping.controlList", DefaultProps.PUMP_DIMENSION_LIST);
Property pumpList = BuildCraftCore.mainConfiguration.get("general", "pumping.controlList", DefaultProps.PUMP_DIMENSION_LIST);
pumpList.comment = "Allows admins to whitelist or blacklist pumping of specific fluids in specific dimensions.\n"
+ "Eg. \"-/-1/Lava\" will disable lava in the nether. \"-/*/Lava\" will disable lava in any dimension. \"+/0/*\" will enable any fluid in the overworld.\n"
+ "Entries are comma seperated, banned fluids have precedence over allowed ones."
Expand Down
4 changes: 2 additions & 2 deletions common/buildcraft/BuildCraftSilicon.java
Expand Up @@ -138,10 +138,10 @@ public class BuildCraftSilicon extends BuildCraftMod {

@Mod.EventHandler
public void preInit(FMLPreInitializationEvent evt) {
chipsetCostMultiplier = BuildCraftCore.mainConfiguration.getFloat("chipset.costMultiplier", Configuration.CATEGORY_GENERAL, 1.0F, 0.001F, 1000.0F, "The multiplier for chipset recipe cost.");
chipsetCostMultiplier = BuildCraftCore.mainConfiguration.getFloat("chipset.costMultiplier", "general", 1.0F, 0.001F, 1000.0F, "The multiplier for chipset recipe cost.");

blacklistedRobots = new ArrayList<String>();
blacklistedRobots.addAll(Arrays.asList(BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "boards.blacklist", new String[]{}).getStringList()));
blacklistedRobots.addAll(Arrays.asList(BuildCraftCore.mainConfiguration.get("general", "boards.blacklist", new String[]{}).getStringList()));

BuildCraftCore.mainConfiguration.save();

Expand Down
14 changes: 7 additions & 7 deletions common/buildcraft/BuildCraftTransport.java
Expand Up @@ -257,21 +257,21 @@ private static class PipeRecipe {
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent evt) {
try {
Property durability = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "pipes.durability", DefaultProps.PIPES_DURABILITY);
Property durability = BuildCraftCore.mainConfiguration.get("general", "pipes.durability", DefaultProps.PIPES_DURABILITY);
durability.comment = "How long a pipe will take to break";
pipeDurability = (float) durability.getDouble(DefaultProps.PIPES_DURABILITY);

Property baseFlowRate = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "pipes.fluids.baseFlowRate", DefaultProps.PIPES_FLUIDS_BASE_FLOW_RATE);
Property baseFlowRate = BuildCraftCore.mainConfiguration.get("general", "pipes.fluids.baseFlowRate", DefaultProps.PIPES_FLUIDS_BASE_FLOW_RATE);
pipeFluidsBaseFlowRate = baseFlowRate.getInt();

Property printFacadeList = BuildCraftCore.mainConfiguration.get("debug", "facades.printFacadeList", false);
debugPrintFacadeList = printFacadeList.getBoolean();

Property enableAdditionalWaterproofingRecipe = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "pipes.fluids.enableAdditionalWaterproofingRecipe", true);
Property enableAdditionalWaterproofingRecipe = BuildCraftCore.mainConfiguration.get("general", "pipes.fluids.enableAdditionalWaterproofingRecipe", true);
enableAdditionalWaterproofingRecipe.comment = "Enable the slimeball based pipe waterproofing recipe";
additionalWaterproofingRecipe = enableAdditionalWaterproofingRecipe.getBoolean();

gateCostMultiplier = BuildCraftCore.mainConfiguration.getFloat("gate.recipeCostMultiplier", Configuration.CATEGORY_GENERAL, 1.0F, 0.001F, 1000.0F, "The multiplier for gate recipe cost.");
gateCostMultiplier = BuildCraftCore.mainConfiguration.getFloat("gate.recipeCostMultiplier", "general", 1.0F, 0.001F, 1000.0F, "The multiplier for gate recipe cost.");

filteredBufferBlock = new BlockFilteredBuffer();
CoreProxy.proxy.registerBlock(filteredBufferBlock.setBlockName("filteredBufferBlock"));
Expand All @@ -280,11 +280,11 @@ public void preInit(FMLPreInitializationEvent evt) {
GateExpansions.registerExpansion(GateExpansionTimer.INSTANCE);
GateExpansions.registerExpansion(GateExpansionRedstoneFader.INSTANCE);

Property groupItemsTriggerProp = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "pipes.groupItemsTrigger", 32);
Property groupItemsTriggerProp = BuildCraftCore.mainConfiguration.get("general", "pipes.groupItemsTrigger", 32);
groupItemsTriggerProp.comment = "when reaching this amount of objects in a pipes, items will be automatically grouped";
groupItemsTrigger = groupItemsTriggerProp.getInt();

Property facadeBlacklistProp = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "facade.blacklist", new String[] {
Property facadeBlacklistProp = BuildCraftCore.mainConfiguration.get("general", "facade.blacklist", new String[] {
Block.blockRegistry.getNameForObject(Blocks.bedrock),
Block.blockRegistry.getNameForObject(Blocks.command_block),
Block.blockRegistry.getNameForObject(Blocks.end_portal_frame),
Expand Down Expand Up @@ -314,7 +314,7 @@ public void preInit(FMLPreInitializationEvent evt) {
facadeBlacklistProp.comment = "Blocks listed here will not have facades created. The format is modid:blockname.\nFor mods with a | character, the value needs to be surrounded with quotes.";
facadeBlacklist = facadeBlacklistProp.getStringList();

Property facadeAsWhitelist = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "facade.treatBlacklistAsWhitelist", false);
Property facadeAsWhitelist = BuildCraftCore.mainConfiguration.get("general", "facade.treatBlacklistAsWhitelist", false);
facadeTreatBlacklistAsWhitelist = facadeAsWhitelist.getBoolean();

pipeWaterproof = new ItemBuildCraft();
Expand Down

0 comments on commit 2f744f1

Please sign in to comment.