From e6ba9dc131d33df8956b59865c2447c7f351c1fe Mon Sep 17 00:00:00 2001 From: OneEyeMaker Date: Sat, 23 Sep 2017 08:20:46 +0300 Subject: [PATCH] Added configuration for Bio Reactor --- .../mod/config/values/ConfigIntValues.java | 7 ++++++- .../mod/tile/TileEntityBioReactor.java | 14 ++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntValues.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntValues.java index 0a153977b..5876e037f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntValues.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntValues.java @@ -115,7 +115,12 @@ public enum ConfigIntValues{ EMPOWERER_CRYSTAL_ENERGY_COST("Empowerer: Empowered Crystal Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 5000, 1, 1000000000, "Amount of energy (per Display Stand) used by Empowerer to create Empowered Crystal"), EMPOWERER_CRYSTAL_CREATION_TIME("Empowerer: Empowered Crystal Creation Time", ConfigCategories.MACHINE_RECIPE_COSTS, 50, 1, 72000, "Time (in ticks) required to create Empowered Crystal in Empowerer"), EMPOWERER_BLOCK_ENERGY_COST("Empowerer: Empowered Crystal Block Creation Cost", ConfigCategories.MACHINE_RECIPE_COSTS, 50000, 1, 1000000000, "Amount of energy (per Display Stand) used by Empowerer to create Empowered Crystal Block"), - EMPOWERER_BLOCK_CREATION_TIME("Empowerer: Empowered Crystal Block Creation Time", ConfigCategories.MACHINE_RECIPE_COSTS, 500, 1, 72000, "Time (in ticks) required to create Empowered Crystal Block in Empowerer"); + EMPOWERER_BLOCK_CREATION_TIME("Empowerer: Empowered Crystal Block Creation Time", ConfigCategories.MACHINE_RECIPE_COSTS, 500, 1, 72000, "Time (in ticks) required to create Empowered Crystal Block in Empowerer"), + + BIO_REACTOR_ENERGY_CAPACITY("Bio Reactor Energy Capacity", ConfigCategories.MACHINE_ENERGY_VALUES, 200000, 1, 1000000000, "Amount of energy Bio Reactor can store"), + BIO_REACTOR_ENERGY_SEND("Bio Reactor Energy Send", ConfigCategories.MACHINE_ENERGY_VALUES, 800, 1, 1000000000, "Amount of energy Bio Reactor can send per tick"), + BIO_REACTOR_ENERGY_PER_ITEM("Bio Reactor Energy Generation Per Item", ConfigCategories.MACHINE_ENERGY_VALUES, 2, 1, 1000000, "Amount of energy Bio Reactor per item/per tick; this value will be squared"), + BIO_REACTOR_BURN_TIME("Bio Reactor Base Reaction Time", ConfigCategories.MACHINE_VALUES, 200, 1, 72000, "Base reaction time (in ticks) for one item in Bio Reactor"); public final String name; public final String category; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBioReactor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBioReactor.java index c90ff1bae..ed7e56387 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBioReactor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBioReactor.java @@ -10,6 +10,10 @@ package de.ellpeck.actuallyadditions.mod.tile; +import java.util.ArrayList; +import java.util.List; + +import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.block.Block; import net.minecraft.block.IGrowable; @@ -23,12 +27,9 @@ import net.minecraft.util.EnumFacing; import net.minecraftforge.common.IPlantable; import net.minecraftforge.energy.IEnergyStorage; -import java.util.ArrayList; -import java.util.List; - public class TileEntityBioReactor extends TileEntityInventoryBase implements ISharingEnergyProvider{ - public final CustomEnergyStorage storage = new CustomEnergyStorage(200000, 0, 800); + public final CustomEnergyStorage storage; public int burnTime; public int maxBurnTime; @@ -39,6 +40,7 @@ public class TileEntityBioReactor extends TileEntityInventoryBase implements ISh public TileEntityBioReactor(){ super(8, "bioReactor"); + this.storage = new CustomEnergyStorage(ConfigIntValues.BIO_REACTOR_ENERGY_CAPACITY.getValue(), 0, ConfigIntValues.BIO_REACTOR_ENERGY_SEND.getValue()); } public static boolean isValidItem(ItemStack stack){ @@ -86,9 +88,9 @@ public class TileEntityBioReactor extends TileEntityInventoryBase implements ISh if(types != null && !types.isEmpty()){ int amount = types.size(); - this.producePerTick = (int)Math.pow(amount*2, 2); + this.producePerTick = (int)Math.pow(amount * ConfigIntValues.BIO_REACTOR_ENERGY_PER_ITEM.getValue(), 2); - this.maxBurnTime = 200-(int)Math.pow(1.8, amount); + this.maxBurnTime = ConfigIntValues.BIO_REACTOR_BURN_TIME.getValue() - (int)Math.pow(1.8, amount); this.burnTime = this.maxBurnTime; } else{