#753 Config options for farm

This commit is contained in:
tterrag1098 committed 2014-06-16 23:58:31 -04:00
1 parent 2ab6085489
commit c31965622a
3 files changed
+13 -2

No files matched your search

@@ -139,6 +139,8 @@ public final class Config {
public static float farmContinuousEnergyUse = 4;
public static float farmActionEnergyUse = 50;
public static int farmDefaultSize = 3;
public static boolean farmAxeDamageOnLeafBreak = false;
public static float farmToolTakeDamageChance = 1;
public static int magnetPowerUsePerSecondRF = 1;
public static int magnetPowerCapacityRF = 100000;
@@ -446,6 +448,10 @@ public final class Config {
"The amount of power used by a farm per action (eg plant, till, harvest) ").getDouble(farmActionEnergyUse);
farmDefaultSize = config.get("Farm Settings", "farmDefaultSize", farmDefaultSize,
"The number of blocks a farm will extend from its center").getInt(farmDefaultSize);
farmAxeDamageOnLeafBreak = config.get("Farm Settings", "farmAxeDamageOnLeafBreak", farmAxeDamageOnLeafBreak,
"Should axes in a farm take damage when breaking leaves?").getBoolean(farmAxeDamageOnLeafBreak);
farmToolTakeDamageChance = (float) config.get("Farm Settings", "farmToolTakeDamageChance", farmToolTakeDamageChance,
"The chance that a tool in the farm will take damage.").getDouble(farmToolTakeDamageChance);
combustionGeneratorUseOpaqueModel = config.get("Aesthetic Settings", "combustionGeneratorUseOpaqueModel", combustionGeneratorUseOpaqueModel,
"If set to true: fluid will not be shown in combustion generator tanks. Improves FPS. ").getBoolean(combustionGeneratorUseOpaqueModel);
@@ -149,10 +149,14 @@ public class TileFarmStation extends AbstractPoweredTaskEntity /*implements IEnt
return;
}
}
}
private void damageTool(Class<? extends Item> class1, Block blk, BlockCoord bc, int damage) {
float rand = worldObj.rand.nextFloat();
if (rand >= Config.farmToolTakeDamageChance)
return;
ItemStack tool = getTool(class1);
if(tool == null) {
return;
@@ -16,6 +16,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.util.ForgeDirection;
import crazypants.enderio.Config;
import crazypants.util.BlockCoord;
public class TreeFarmer implements IFarmerJoe {
@@ -102,7 +103,7 @@ public class TreeFarmer implements IFarmerJoe {
}
boolean isWood = true;
if(blk != wood) { //leaves
isWood = false;
isWood = Config.farmAxeDamageOnLeafBreak;
int leaveMeta = farm.getBlockMeta(coord);
boolean canDropApple =
(blk instanceof BlockOldLeaf && (leaveMeta == 0 || leaveMeta == 8)) || //oak