Added configuration for Coal Generator

This commit is contained in:
OneEyeMaker 2017-09-27 07:35:20 +03:00
parent 7937f55639
commit c95110fbf7
3 changed files with 8 additions and 5 deletions

View file

@ -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("<rf>", TileEntityCoalGenerator.PRODUCE), new PageCrafting(2, BlockCrafting.recipeCoalGen).setWildcard().setNoText());
chaptersIntroduction[5] = new BookletChapter("coalGen", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockCoalGenerator), new PageTextOnly(1).addTextReplacement("<rf>", ConfigIntValues.COAL_GENERATOR_ENERGY_PRODUCTION.getValue()), new PageCrafting(2, BlockCrafting.recipeCoalGen).setWildcard().setNoText());
ArrayList<BookletPage> empowererPages = new ArrayList<BookletPage>();
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++){

View file

@ -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;

View file

@ -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()){