From c95110fbf7c10c376a2bf0134756dbf17132f103 Mon Sep 17 00:00:00 2001 From: OneEyeMaker Date: Wed, 27 Sep 2017 07:35:20 +0300 Subject: [PATCH] Added configuration for Coal Generator --- .../ellpeck/actuallyadditions/mod/booklet/InitBooklet.java | 2 +- .../mod/config/values/ConfigIntValues.java | 5 ++++- .../actuallyadditions/mod/tile/TileEntityCoalGenerator.java | 6 +++--- 3 files changed, 8 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 ac98f4b79..0dcc2a04d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -145,7 +145,7 @@ public final class InitBooklet{ crystalPages.add(new PageCrafting(crystalPages.size()+1, MiscCrafting.RECIPES_CRYSTAL_BLOCKS).setNoText()); chaptersIntroduction[2] = new BookletChapter("engineerHouse", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(Items.EMERALD), new PageTextOnly(1), new PagePicture(2, "page_engineer_house", 145)); chaptersIntroduction[6] = new BookletChapter("crystals", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockAtomicReconstructor), crystalPages.toArray(new BookletPage[crystalPages.size()])).setSpecial(); - chaptersIntroduction[5] = new BookletChapter("coalGen", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockCoalGenerator), new PageTextOnly(1).addTextReplacement("", TileEntityCoalGenerator.PRODUCE), new PageCrafting(2, BlockCrafting.recipeCoalGen).setWildcard().setNoText()); + chaptersIntroduction[5] = new BookletChapter("coalGen", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockCoalGenerator), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.COAL_GENERATOR_ENERGY_PRODUCTION.getValue()), new PageCrafting(2, BlockCrafting.recipeCoalGen).setWildcard().setNoText()); ArrayList empowererPages = new ArrayList(); empowererPages.addAll(Arrays.asList(new PageTextOnly(1), new PagePicture(2, "page_empowerer", 137), new PageCrafting(3, BlockCrafting.recipeEmpowerer), new PageCrafting(4, BlockCrafting.recipeDisplayStand))); for(int i = 0; i < EmpowererHandler.MAIN_PAGE_RECIPES.size(); i++){ 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 d26c56f3d..b6310a754 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 @@ -70,7 +70,10 @@ public enum ConfigIntValues{ ENERGIZER_ENERGY_CAPACITY("Energizer: Energy Capacity", ConfigCategories.MACHINE_ENERGY_VALUES, 50000, 1000, 1000000000, "Amount of energy Energizer can store."), ENERGIZER_ENERGY_RECEIVE("Energizer: Energy Receive Rate", ConfigCategories.MACHINE_ENERGY_VALUES, 1000, 1, 1000000000, "Amount of energy Energizer can receive per tick"), ENERVATOR_ENERGY_CAPACITY("Enervator: Energy Capacity", ConfigCategories.MACHINE_ENERGY_VALUES, 50000, 1000, 1000000000, "Amount of energy Enervator can store."), - ENERVATOR_ENERGY_SEND("Enervator: Energy Send Rate", ConfigCategories.MACHINE_ENERGY_VALUES, 1000, 1, 1000000000, "Amount of energy Enervator can send per tick"); + ENERVATOR_ENERGY_SEND("Enervator: Energy Send Rate", ConfigCategories.MACHINE_ENERGY_VALUES, 1000, 1, 1000000000, "Amount of energy Enervator can send per tick"), + COAL_GENERATOR_ENERGY_CAPACITY("Coal Generator: Energy Capacity", ConfigCategories.MACHINE_ENERGY_VALUES, 60000, 1000, 1000000000, "Amount of energy Coal Generator can store."), + COAL_GENERATOR_ENERGY_SEND("Coal Generator: Energy Send Rate", ConfigCategories.MACHINE_ENERGY_VALUES, 80, 1, 1000000000, "Amount of energy Coal Generator can send per tick."), + COAL_GENERATOR_ENERGY_PRODUCTION("Coal Generator: Energy Production", ConfigCategories.MACHINE_ENERGY_VALUES, 30, 1, 1000000000, "Amount of energy Coal Generator can produces per tick."); public final String name; public final String category; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java index 864a407e2..dbc2c1bd1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.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.StackUtil; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -22,8 +23,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class TileEntityCoalGenerator extends TileEntityInventoryBase implements ISharingEnergyProvider{ - public static final int PRODUCE = 30; - public final CustomEnergyStorage storage = new CustomEnergyStorage(60000, 0, 80); + public final CustomEnergyStorage storage = new CustomEnergyStorage(ConfigIntValues.COAL_GENERATOR_ENERGY_CAPACITY.getValue(), 0, ConfigIntValues.COAL_GENERATOR_ENERGY_SEND.getValue()); public int maxBurnTime; public int currentBurnTime; private int lastEnergy; @@ -73,7 +73,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements if(this.currentBurnTime > 0){ this.currentBurnTime--; - this.storage.receiveEnergyInternal(PRODUCE, false); + this.storage.receiveEnergyInternal(ConfigIntValues.COAL_GENERATOR_ENERGY_PRODUCTION.getValue(), false); } if(!this.isRedstonePowered && this.currentBurnTime <= 0 && StackUtil.isValid(this.slots.getStackInSlot(0)) && TileEntityFurnace.getItemBurnTime(this.slots.getStackInSlot(0)) > 0 && this.storage.getEnergyStored() < this.storage.getMaxEnergyStored()){