mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-23 07:38:34 +01:00
Added configuration for Lava Factory
This commit is contained in:
parent
06ab7c817a
commit
30ca7b5937
3 changed files with 11 additions and 6 deletions
|
@ -227,7 +227,7 @@ public final class InitBooklet{
|
|||
new BookletChapterCoffee("coffeeMachine", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockCoffeeMachine), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemCoffeeBean)).addTextReplacement("<rf>", TileEntityCoffeeMachine.ENERGY_USED).addTextReplacement("<coffee>", TileEntityCoffeeMachine.CACHE_USE).addTextReplacement("<water>", TileEntityCoffeeMachine.WATER_USE), new PageTextOnly(2).addItemsToPage(new ItemStack(InitItems.itemCoffee)), new PagePicture(3, "page_coffee_machine", 115), new PageCrafting(4, BlockCrafting.recipeCoffeeMachine).setWildcard().setNoText(), new PageCrafting(5, ItemCrafting.recipeCup).setNoText()).setImportant();
|
||||
new BookletChapterCrusher("crusher", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockGrinderDouble), new PageTextOnly(1).addTextReplacement("<rf>", ConfigIntListValues.CRUSHER_ENERGY_USE.getValue()[0]), new PageCrafting(2, BlockCrafting.recipeCrusher).setWildcard().setNoText(), new PageCrafting(3, BlockCrafting.recipeDoubleCrusher).setWildcard().setNoText(), new PageCrusherRecipe(4, CrusherCrafting.recipeIronHorseArmor).setNoText(), new PageCrusherRecipe(5, CrusherCrafting.recipeGoldHorseArmor).setNoText(), new PageCrusherRecipe(6, CrusherCrafting.recipeDiamondHorseArmor).setNoText());
|
||||
new BookletChapter("furnaceDouble", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFurnaceDouble), new PageCrafting(1, BlockCrafting.recipeFurnace).setWildcard().addTextReplacement("<rf>", ConfigIntValues.POWERED_FURNACE_ENERGY_USE.getValue()));
|
||||
new BookletChapter("lavaFactory", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockLavaFactoryController), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityLavaFactoryController.ENERGY_USE), new PagePicture(2, "page_lava_factory", 0).setNoText(), new PageCrafting(3, BlockCrafting.recipeLavaFactory).setNoText(), new PageCrafting(4, BlockCrafting.recipeCasing).setNoText());
|
||||
new BookletChapter("lavaFactory", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockLavaFactoryController), new PageTextOnly(1).addTextReplacement("<rf>", ConfigIntValues.LAVA_FACTORY_ENERGY_USE.getValue()), new PagePicture(2, "page_lava_factory", 0).setNoText(), new PageCrafting(3, BlockCrafting.recipeLavaFactory).setNoText(), new PageCrafting(4, BlockCrafting.recipeCasing).setNoText());
|
||||
new BookletChapter("energizer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockEnergizer), new PageCrafting(1, BlockCrafting.recipeEnergizer), new PageCrafting(2, BlockCrafting.recipeEnervator));
|
||||
new BookletChapter("repairer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockItemRepairer), new PageCrafting(1, BlockCrafting.recipeRepairer).addTextReplacement("<rf>", TileEntityItemRepairer.ENERGY_USE));
|
||||
new BookletChapter("longRangeBreaker", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockDirectionalBreaker), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityDirectionalBreaker.ENERGY_USE).addTextReplacement("<range>", TileEntityDirectionalBreaker.RANGE), new PageCrafting(2, BlockCrafting.recipeDirectionalBreaker).setWildcard());
|
||||
|
|
|
@ -105,7 +105,11 @@ public enum ConfigIntValues{
|
|||
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."),
|
||||
VERTICAL_DIGGER_ENERGY_USE_PER_ORE("Vertical Digger: Energy Use Per Ore", ConfigCategories.MACHINE_ENERGY_VALUES, 1950, 1, 1000000000, "Amount of energy Vertical Digger uses to mine block in mode 'Only Ores'"),
|
||||
VERTICAL_DIGGER_WORK_RANGE("Vertical Digger: Work Range", ConfigCategories.MACHINE_VALUES, 2, 1, 8, "Distance in blocks in which Vertical Digger can mine blocks.");
|
||||
VERTICAL_DIGGER_WORK_RANGE("Vertical Digger: Work Range", ConfigCategories.MACHINE_VALUES, 2, 1, 8, "Distance in blocks in which Vertical Digger can mine blocks."),
|
||||
LAVA_FACTORY_ENERGY_CAPACITY("Lava Factory: Energy Capacity", ConfigCategories.MACHINE_ENERGY_VALUES, 300000, 1000, 1000000000, "Amount of energy Lava Factory can store."),
|
||||
LAVA_FACTORY_ENERGY_RECEIVE("Lava Factory: Energy Receive Rate", ConfigCategories.MACHINE_ENERGY_VALUES, 2000, 1, 1000000000, "Amount of energy Lava Factory can receive per tick."),
|
||||
LAVA_FACTORY_ENERGY_USE("Lava Factory: Energy Use", ConfigCategories.MACHINE_ENERGY_VALUES, 150000, 1, 1000000000, "Amount of energy Lava Factory uses to create block of lava."),
|
||||
LAVA_FACTORY_PRODUCTION_DURATION("Lava Factory: Production Duration", ConfigCategories.MACHINE_RECIPE_COSTS, 200, 1, 72000, "Time in ticks required by Lava Factory to produce block of lava.");
|
||||
|
||||
public final String name;
|
||||
public final String category;
|
||||
|
|
|
@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod.tile;
|
|||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
|
||||
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -26,8 +27,7 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I
|
|||
public static final int NOT_MULTI = 0;
|
||||
public static final int HAS_LAVA = 1;
|
||||
public static final int HAS_AIR = 2;
|
||||
public static final int ENERGY_USE = 150000;
|
||||
public final CustomEnergyStorage storage = new CustomEnergyStorage(300000, 2000, 0);
|
||||
public final CustomEnergyStorage storage = new CustomEnergyStorage(ConfigIntValues.LAVA_FACTORY_ENERGY_CAPACITY.getValue(), ConfigIntValues.LAVA_FACTORY_ENERGY_RECEIVE.getValue(), 0);
|
||||
private int currentWorkTime;
|
||||
private int oldEnergy;
|
||||
|
||||
|
@ -57,12 +57,13 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I
|
|||
public void updateEntity(){
|
||||
super.updateEntity();
|
||||
if(!this.world.isRemote){
|
||||
if(this.storage.getEnergyStored() >= ENERGY_USE && this.isMultiblock() == HAS_AIR){
|
||||
int energyUse = ConfigIntValues.LAVA_FACTORY_ENERGY_USE.getValue();
|
||||
if(this.storage.getEnergyStored() >= energyUse && this.isMultiblock() == HAS_AIR){
|
||||
this.currentWorkTime++;
|
||||
if(this.currentWorkTime >= 200){
|
||||
this.currentWorkTime = 0;
|
||||
this.world.setBlockState(this.pos.up(), Blocks.LAVA.getDefaultState(), 2);
|
||||
this.storage.extractEnergyInternal(ENERGY_USE, false);
|
||||
this.storage.extractEnergyInternal(energyUse, false);
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
|
Loading…
Reference in a new issue