Add config option for distillation fluid effect

This commit is contained in:
tterrag1098 committed 2014-07-19 03:03:55 -04:00
1 parent f0325927e1
commit c70683fac3
3 files changed
+10 -3

No files matched your search

@@ -54,9 +54,9 @@ public final class Config {
public static final Section sectionAesthetic = new Section("Aesthetic Settings", "aesthetic");
public static final Section sectionAdvanced = new Section("Advanced Settings", "advanced");
public static final Section sectionMagnet = new Section("Magnet Settings", "magnet");
public static final Section sectionFluid = new Section("Fluid Settings", "fluid");
public static final Section sectionSpawner = new Section("PoweredSpawner Settings", "spawner");
static int BID = 700;
static int IID = 8524;
@@ -228,6 +228,8 @@ public final class Config {
public static int wirelessChargerRange = 24;
public static long nutrientFoodBoostDelay = 400;
public static void load(FMLPreInitializationEvent event) {
FMLCommonHandler.instance().bus().register(new Config());
@@ -590,6 +592,7 @@ public final class Config {
useModMetals = config.get(sectionRecipe.name, "useModMetals", useModMetals,
"If true copper and tin will be used in recipes when registered in the ore dictionary").getBoolean(useModMetals);
nutrientFoodBoostDelay = config.get(sectionFluid.name, "nutrientFluidFoodBoostDelay", nutrientFoodBoostDelay, "The delay in ticks between when nutrient distillation boosts your food value.").getInt();
}
private Config() {
@@ -19,6 +19,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.EnderIO;
import crazypants.enderio.config.Config;
public class BlockFluidEio extends BlockFluidClassic {
@@ -87,7 +88,7 @@ public class BlockFluidEio extends BlockFluidClassic {
} else if(this == EnderIO.blockNutrientDistillation && entity instanceof EntityPlayerMP) {
long time = entity.worldObj.getTotalWorldTime();
EntityPlayerMP player = (EntityPlayerMP) entity;
if(time % 200 == 0 && player.getEntityData().getLong("eioLastFoodBoost") != time)
if(time % Config.nutrientFoodBoostDelay == 0 && player.getEntityData().getLong("eioLastFoodBoost") != time)
{
int food = player.getFoodStats().getFoodLevel();
float sat = player.getFoodStats().getSaturationLevel();