Added configuration for Solar Panel

This commit is contained in:
OneEyeMaker 2017-10-04 09:24:21 +03:00
parent 59e0239c7d
commit 9fc905fb11
3 changed files with 7 additions and 4 deletions

View file

@ -236,7 +236,7 @@ public final class InitBooklet{
new BookletChapter("shockSuppressor", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockShockSuppressor), new PageTextOnly(1).addTextReplacement("<range>", ConfigIntValues.SHOCK_ABSORBER_WORK_RANGE.getValue()).addTextReplacement("<rf>", ConfigIntValues.SHOCK_ABSORBER_ENERGY_USE.getValue()), new PageCrafting(2, BlockCrafting.recipeShockSuppressor));
//RF Generating Blocks
new BookletChapter("solarPanel", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFurnaceSolar), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityFurnaceSolar.PRODUCE), new PageCrafting(2, BlockCrafting.recipeSolar).setNoText());
new BookletChapter("solarPanel", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFurnaceSolar), new PageTextOnly(1).addTextReplacement("<rf>", ConfigIntValues.SOLAR_PANEL_ENERGY_PRODUCTION.getValue()), new PageCrafting(2, BlockCrafting.recipeSolar).setNoText());
new BookletChapter("heatCollector", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockHeatCollector), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityHeatCollector.ENERGY_PRODUCE).addTextReplacement("<min>", TileEntityHeatCollector.BLOCKS_NEEDED), new PageCrafting(2, BlockCrafting.recipeHeatCollector).setNoText());
new BookletChapter("canola", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFermentingBarrel), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())).addItemsToPage(new ItemStack(InitItems.itemCanolaSeed)).addFluidToPage(InitFluids.fluidCanolaOil), new PageTextOnly(2).addFluidToPage(InitFluids.fluidRefinedCanolaOil).addFluidToPage(InitFluids.fluidCrystalOil).addFluidToPage(InitFluids.fluidEmpoweredOil), new PageCrafting(3, BlockCrafting.recipeCanolaPress).setNoText(), new PageCrafting(4, BlockCrafting.recipeFermentingBarrel), new PageCrafting(5, BlockCrafting.recipeOilGen), new PageReconstructor(6, LensRecipeHandler.recipeCrystallizedCanolaSeed).setNoText(), new PageEmpowerer(7, EmpowererHandler.recipeEmpoweredCanolaSeed).setNoText());
new BookletChapter("leafGen", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockLeafGenerator), new PageTextOnly(1).addTextReplacement("<rf>", ConfigIntValues.LEAF_GENERATOR_ENERGY_PRODUCTION.getValue()).addTextReplacement("<range>", ConfigIntValues.LEAF_GENERATOR_WORK_RANGE.getValue()), new PageCrafting(2, BlockCrafting.recipeLeafGen)).setImportant();

View file

@ -124,6 +124,9 @@ public enum ConfigIntValues{
SHOCK_ABSORBER_ENERGY_RECEIVE("Shock Absorber: Energy Receive Rate", ConfigCategories.MACHINE_ENERGY_VALUES, 400, 1, 1000000000, "Amount of energy Shock Absorber can receive per tick."),
SHOCK_ABSORBER_ENERGY_USE("Shock Absorber: Energy Use", ConfigCategories.MACHINE_ENERGY_VALUES, 300, 1, 1000000000, "Amount of energy Shock Absorber uses to protect block or entity."),
SHOCK_ABSORBER_WORK_RANGE("Shock Absorber: Work Range", ConfigCategories.MACHINE_VALUES, 5, 1, 16, "Distance in block in which Shock Absorber protects blocks and entities."),
SOLAR_PANEL_ENERGY_CAPACITY("Solar Panel: Energy Capacity", ConfigCategories.MACHINE_ENERGY_VALUES, 30000, 1000, 1000000000, "Amount of energy Solar Panel can store."),
SOLAR_PANEL_ENERGY_SEND("Solar Panel: Energy Send Rate", ConfigCategories.MACHINE_ENERGY_VALUES, 200, 1, 1000000000, "Amount of energy Solar Panel can send per tick."),
SOLAR_PANEL_ENERGY_PRODUCTION("Solar Panel: Energy Production", ConfigCategories.MACHINE_ENERGY_VALUES, 8, 1, 1000000000, "Amount of energy Solar Panel produces per tick."),
VERTICAL_DIGGER_ENERGY_CAPACITY("Vertical Digger: Energy Capacity", ConfigCategories.MACHINE_ENERGY_VALUES, 200000, 1000, 1000000000, "Amount of energy Vertical Digger can store."),
VERTICAL_DIGGER_ENERGY_RECEIVE("Vertical Digger: Energy Receive Rate", ConfigCategories.MACHINE_ENERGY_VALUES, 2000, 1, 1000000000, "Amount of energy Vertical Digger can receive per tick."),
VERTICAL_DIGGER_ENERGY_USE_PER_BLOCK("Vertical Digger: Energy Use Per Block", ConfigCategories.MACHINE_ENERGY_VALUES, 650, 1, 1000000000, "Amount of energy Vertical Digger uses to mine block."),

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import net.minecraft.block.state.IBlockState;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
@ -19,8 +20,7 @@ import net.minecraftforge.energy.IEnergyStorage;
public class TileEntityFurnaceSolar extends TileEntityBase implements ISharingEnergyProvider, IEnergyDisplay{
public static final int PRODUCE = 8;
public final CustomEnergyStorage storage = new CustomEnergyStorage(30000, 0, 100);
public final CustomEnergyStorage storage = new CustomEnergyStorage(ConfigIntValues.SOLAR_PANEL_ENERGY_CAPACITY.getValue(), 0, ConfigIntValues.SOLAR_PANEL_ENERGY_SEND.getValue());
private int oldEnergy;
public TileEntityFurnaceSolar(){
@ -43,7 +43,7 @@ public class TileEntityFurnaceSolar extends TileEntityBase implements ISharingEn
public void updateEntity(){
super.updateEntity();
if(!this.world.isRemote){
int power = this.getPowerToGenerate(PRODUCE);
int power = this.getPowerToGenerate(ConfigIntValues.SOLAR_PANEL_ENERGY_PRODUCTION.getValue());
if(this.world.isDaytime() && power > 0){
if(power <= this.storage.getMaxEnergyStored()-this.storage.getEnergyStored()){
this.storage.receiveEnergyInternal(power, false);