Added configuration for Firework Box

This commit is contained in:
OneEyeMaker 2017-10-04 09:17:32 +03:00
parent 55c948f144
commit 59e0239c7d
3 changed files with 9 additions and 5 deletions

View file

@ -220,7 +220,7 @@ public final class InitBooklet{
new BookletChapter("rangedCollector", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockRangedCollector), new PageTextOnly(1).addTextReplacement("<range>", TileEntityRangedCollector.RANGE), new PageCrafting(2, BlockCrafting.recipeRangedCollector).setNoText());
//RF Using Blocks
new BookletChapter("fireworkBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFireworkBox), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityFireworkBox.USE_PER_SHOT), new PageCrafting(2, BlockCrafting.recipeFireworkBox)).setSpecial();
new BookletChapter("fireworkBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFireworkBox), new PageTextOnly(1).addTextReplacement("<rf>", ConfigIntValues.FIREWORK_BOX_ENERGY_USE.getValue()), new PageCrafting(2, BlockCrafting.recipeFireworkBox)).setSpecial();
new BookletChapter("batteryBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockBatteryBox), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeBatteryBox).setNoText()).setSpecial();
new BookletChapter("farmer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFarmer), new PageTextOnly(1), new PagePicture(2, "page_farmer_crops", 95).addItemsToPage(new ItemStack(Items.WHEAT_SEEDS)).addItemsToPage(new ItemStack(InitItems.itemCanolaSeed)), new PagePicture(3, "page_farmer_cactus", 105).addItemsToPage(new ItemStack(Blocks.CACTUS)), new PagePicture(4, "page_farmer_wart", 95).addItemsToPage(new ItemStack(Items.NETHER_WART)), new PagePicture(5, "page_farmer_reeds", 105).addItemsToPage(new ItemStack(Items.REEDS)), new PagePicture(6, "page_farmer_melons", 105).addItemsToPage(new ItemStack(Items.MELON), new ItemStack(Blocks.PUMPKIN), new ItemStack(Blocks.MELON_BLOCK)), new PagePicture(7, "page_farmer_enderlilly", 105), new PagePicture(8, "page_farmer_redorchid", 105), new PageCrafting(4, BlockCrafting.recipeFarmer).setWildcard().setNoText()).setImportant();
new BookletChapter("miner", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockMiner), new PageTextOnly(1).addTextReplacement("<rf>", ConfigIntValues.VERTICAL_DIGGER_ENERGY_USE_PER_BLOCK.getValue()).addTextReplacement("<range>", ConfigIntValues.VERTICAL_DIGGER_WORK_RANGE.getValue()), new PageCrafting(2, BlockCrafting.recipeMiner)).setSpecial();

View file

@ -89,6 +89,9 @@ public enum ConfigIntValues{
FERMENTING_BARREL_PROCESSING_DURATION("Fermenting Barrel: Processing Duration", ConfigCategories.MACHINE_RECIPE_COSTS, 100, 1, 72000, "Time in ticks required for one operation in Fermenting Barrel."),
FERMENTING_BARREL_CONSUMPTION_AMOUNT("Fermenting Barrel: Consumption Amount", ConfigCategories.MACHINE_RECIPE_COSTS, 80, 1, 2000, "Amount of Canola Oil (in mB) Fermenting Barrel uses per operation."),
FERMENTING_BARREL_PRODUCTION_AMOUNT("Fermenting Barrel: Production Amount", ConfigCategories.MACHINE_RECIPE_COSTS, 80, 1, 2000, "Amount of Refined Canola Oil Fermenting Barrel produces per operation."),
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."),
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."),

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.network.gui.INumberReactor;
import net.minecraft.entity.item.EntityFireworkRocket;
import net.minecraft.entity.player.EntityPlayer;
@ -30,8 +31,7 @@ import java.util.List;
public class TileEntityFireworkBox extends TileEntityBase implements IEnergyDisplay, INumberReactor{
public static final int USE_PER_SHOT = 500;
public final CustomEnergyStorage storage = new CustomEnergyStorage(20000, 200, 0);
public final CustomEnergyStorage storage = new CustomEnergyStorage(ConfigIntValues.FIREWORK_BOX_ENERGY_CAPACITY.getValue(), ConfigIntValues.FIREWORK_BOX_ENERGY_USE.getValue(), 0);
public int intValuePlay = 2;
public int chargeAmount = 2;
public int flightTime = 2;
@ -246,10 +246,11 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyDisp
}
private void doWork(){
if(this.storage.getEnergyStored() >= USE_PER_SHOT){
int energyUse = ConfigIntValues.FIREWORK_BOX_ENERGY_USE.getValue();
if(this.storage.getEnergyStored() >= energyUse){
this.spawnFireworks(this.world, this.pos.getX(), this.pos.getY(), this.pos.getZ());
this.storage.extractEnergyInternal(USE_PER_SHOT, false);
this.storage.extractEnergyInternal(energyUse, false);
}
}