From f2fa06f3c24330b40c0a04f389a52ed1b8999e23 Mon Sep 17 00:00:00 2001 From: OneEyeMaker Date: Wed, 4 Oct 2017 09:31:23 +0300 Subject: [PATCH] Added configuration for Heat Collector --- .../actuallyadditions/mod/booklet/InitBooklet.java | 2 +- .../mod/config/values/ConfigIntValues.java | 3 +++ .../mod/tile/TileEntityHeatCollector.java | 9 +++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java index f5cedfb0a..4eec89673 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -237,7 +237,7 @@ public final class InitBooklet{ //RF Generating Blocks new BookletChapter("solarPanel", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFurnaceSolar), new PageTextOnly(1).addTextReplacement("", 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("", TileEntityHeatCollector.ENERGY_PRODUCE).addTextReplacement("", TileEntityHeatCollector.BLOCKS_NEEDED), new PageCrafting(2, BlockCrafting.recipeHeatCollector).setNoText()); + new BookletChapter("heatCollector", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockHeatCollector), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.HEAT_COLLECTOR_ENERGY_PRODUCTION.getValue()).addTextReplacement("", 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("", ConfigIntValues.LEAF_GENERATOR_ENERGY_PRODUCTION.getValue()).addTextReplacement("", ConfigIntValues.LEAF_GENERATOR_WORK_RANGE.getValue()), new PageCrafting(2, BlockCrafting.recipeLeafGen)).setImportant(); new BookletChapter("bioReactor", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockBioReactor), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeBioReactor).setNoText()).setSpecial(); 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 0d3f35689..10cbe0810 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 @@ -92,6 +92,9 @@ public enum ConfigIntValues{ FIREWORK_BOX_ENERGY_CAPACITY("Firework Box: Energy Capacity", ConfigCategories.MACHINE_ENERGY_VALUES, 20000, 1000, 1000000000, "Amount of energy Firework Box can store."), FIREWORK_BOX_ENERGY_RECEIVE("Firework Box: Energy Receive Rate", ConfigCategories.MACHINE_ENERGY_VALUES, 200, 1, 1000000000, "Amount of energy Firework Box can receive per tick."), FIREWORK_BOX_ENERGY_USE("Firework Box: Energy Use", ConfigCategories.MACHINE_ENERGY_VALUES, 500, 1, 1000000000, "Amount of energy Firework Box uses per shot."), + HEAT_COLLECTOR_ENERGY_CAPACITY("Heat Collector: Energy Capacity", ConfigCategories.MACHINE_ENERGY_VALUES, 30000, 1000, 1000000000, "Amount of energy Heat Collector can store."), + HEAT_COLLECTOR_ENERGY_SEND("Heat Collector: Energy Send Rate", ConfigCategories.MACHINE_ENERGY_VALUES, 80, 1, 1000000000, "Amount of energy Heat Collector can send per tick."), + HEAT_COLLECTOR_ENERGY_PRODUCTION("Heat Collector: Energy Production", ConfigCategories.MACHINE_ENERGY_VALUES, 40, 1, 1000000000, "Amount of energy Heat Collector produces per tick."), ITEM_REPAIRER_ENERGY_CAPACITY("Item Repairer: Energy Capacity", ConfigCategories.MACHINE_ENERGY_VALUES, 300000, 1000, 1000000000, "Amount of energy Item Repairer can store."), ITEM_REPAIRER_ENERGY_RECEIVE("Item Repairer: Energy Receive Rate", ConfigCategories.MACHINE_ENERGY_VALUES, 6000, 1, 1000000000, "Amount of energy Item Repairer can receive per tick."), ITEM_REPAIRER_ENERGY_USE("Item Repairer: Energy Use", ConfigCategories.MACHINE_ENERGY_VALUES, 2500, 1, 1000000000, "Amount of energy Item Repairer uses per tick."), diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java index 905fcc7f5..443e5129b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.tile; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockMagma; @@ -25,9 +26,8 @@ import java.util.ArrayList; public class TileEntityHeatCollector extends TileEntityBase implements ISharingEnergyProvider, IEnergyDisplay{ - public static final int ENERGY_PRODUCE = 40; public static final int BLOCKS_NEEDED = 4; - public final CustomEnergyStorage storage = new CustomEnergyStorage(30000, 0, 80); + public final CustomEnergyStorage storage = new CustomEnergyStorage(ConfigIntValues.HEAT_COLLECTOR_ENERGY_CAPACITY.getValue(), 0, ConfigIntValues.HEAT_COLLECTOR_ENERGY_SEND.getValue()); private int oldEnergy; private int disappearTime; @@ -59,8 +59,9 @@ public class TileEntityHeatCollector extends TileEntityBase implements ISharingE public void updateEntity(){ super.updateEntity(); if(!this.world.isRemote){ + int energyProduction = ConfigIntValues.HEAT_COLLECTOR_ENERGY_PRODUCTION.getValue(); ArrayList blocksAround = new ArrayList(); - if(ENERGY_PRODUCE <= this.storage.getMaxEnergyStored()-this.storage.getEnergyStored()){ + if(energyProduction <= this.storage.getMaxEnergyStored()-this.storage.getEnergyStored()){ for(int i = 1; i <= 5; i++){ BlockPos coords = this.pos.offset(WorldUtil.getDirectionBySidesInOrder(i)); IBlockState state = this.world.getBlockState(coords); @@ -71,7 +72,7 @@ public class TileEntityHeatCollector extends TileEntityBase implements ISharingE } if(blocksAround.size() >= BLOCKS_NEEDED){ - this.storage.receiveEnergyInternal(ENERGY_PRODUCE, false); + this.storage.receiveEnergyInternal(energyProduction, false); this.markDirty(); this.disappearTime++;