From 59e0239c7db1345930c91aa2d88bf03683202854 Mon Sep 17 00:00:00 2001 From: OneEyeMaker Date: Wed, 4 Oct 2017 09:17:32 +0300 Subject: [PATCH] Added configuration for Firework Box --- .../actuallyadditions/mod/booklet/InitBooklet.java | 2 +- .../mod/config/values/ConfigIntValues.java | 3 +++ .../mod/tile/TileEntityFireworkBox.java | 9 +++++---- 3 files changed, 9 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 b6c1c869b..f2e6316a3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -220,7 +220,7 @@ public final class InitBooklet{ new BookletChapter("rangedCollector", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockRangedCollector), new PageTextOnly(1).addTextReplacement("", TileEntityRangedCollector.RANGE), new PageCrafting(2, BlockCrafting.recipeRangedCollector).setNoText()); //RF Using Blocks - new BookletChapter("fireworkBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFireworkBox), new PageTextOnly(1).addTextReplacement("", TileEntityFireworkBox.USE_PER_SHOT), new PageCrafting(2, BlockCrafting.recipeFireworkBox)).setSpecial(); + new BookletChapter("fireworkBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFireworkBox), new PageTextOnly(1).addTextReplacement("", 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("", ConfigIntValues.VERTICAL_DIGGER_ENERGY_USE_PER_BLOCK.getValue()).addTextReplacement("", ConfigIntValues.VERTICAL_DIGGER_WORK_RANGE.getValue()), new PageCrafting(2, BlockCrafting.recipeMiner)).setSpecial(); 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 b7eb47115..fe36ab1c6 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 @@ -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."), diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java index 748f3c4ce..e0abf86a3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java @@ -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); } }