mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-23 07:38:34 +01:00
Added configuration for Heat Collector
This commit is contained in:
parent
9fc905fb11
commit
f2fa06f3c2
3 changed files with 9 additions and 5 deletions
|
@ -237,7 +237,7 @@ public final class InitBooklet{
|
|||
|
||||
//RF Generating Blocks
|
||||
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("heatCollector", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockHeatCollector), new PageTextOnly(1).addTextReplacement("<rf>", ConfigIntValues.HEAT_COLLECTOR_ENERGY_PRODUCTION.getValue()).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();
|
||||
new BookletChapter("bioReactor", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockBioReactor), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeBioReactor).setNoText()).setSpecial();
|
||||
|
|
|
@ -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."),
|
||||
|
|
|
@ -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<Integer> blocksAround = new ArrayList<Integer>();
|
||||
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++;
|
||||
|
|
Loading…
Reference in a new issue