From 075862361da756c59be3b0d6fedc6eb903052b76 Mon Sep 17 00:00:00 2001 From: OneEyeMaker Date: Thu, 28 Sep 2017 09:05:58 +0300 Subject: [PATCH] Added configuration for Crusher and Double Crusher --- .../mod/booklet/InitBooklet.java | 2 +- .../mod/config/values/ConfigIntListValues.java | 4 +++- .../mod/config/values/ConfigIntValues.java | 4 +++- .../mod/tile/TileEntityGrinder.java | 17 ++++++++++------- 4 files changed, 17 insertions(+), 10 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 9d0f268a9..91c39dbe8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -225,7 +225,7 @@ public final class InitBooklet{ 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("", TileEntityMiner.ENERGY_USE_PER_BLOCK).addTextReplacement("", TileEntityMiner.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipeMiner)).setSpecial(); new BookletChapterCoffee("coffeeMachine", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockCoffeeMachine), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemCoffeeBean)).addTextReplacement("", TileEntityCoffeeMachine.ENERGY_USED).addTextReplacement("", TileEntityCoffeeMachine.CACHE_USE).addTextReplacement("", 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("", TileEntityGrinder.ENERGY_USE), 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 BookletChapterCrusher("crusher", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockGrinderDouble), new PageTextOnly(1).addTextReplacement("", 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("", ConfigIntValues.POWERED_FURNACE_ENERGY_USE.getValue())); new BookletChapter("lavaFactory", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockLavaFactoryController), new PageTextOnly(1).addTextReplacement("", 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("energizer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockEnergizer), new PageCrafting(1, BlockCrafting.recipeEnergizer), new PageCrafting(2, BlockCrafting.recipeEnervator)); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntListValues.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntListValues.java index 81b93a1c9..61ec544af 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntListValues.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntListValues.java @@ -29,7 +29,9 @@ public enum ConfigIntListValues{ OIL_GENERATOR_ENERGY_PRODUCTION("Oil Generator: Energy Production", ConfigCategories.MACHINE_ENERGY_VALUES, new int[]{40, 80, 100, 120}, "Amound of energy Oil Generator produces for each oil type.\nThese values change energy density of each type of oil.\nConfig option 'Oil Gen: Power Values' is obsolete, please remove it."), OIL_GENERATOR_BURN_TIME("Oil Generator: Production Time", ConfigCategories.MACHINE_VALUES, new int[]{100, 120, 280, 400}, "Time in seconds each type of oil burns in Oil Generator.\nThese values change burn time of each type of oil.\nConfig option 'Oil Gen: Time Values' is obsolete, please remove it."), LASER_RELAY_ENERGY_TRANSFER("Energy Laser Relay: Energy Transfer Rate Per Tier", ConfigCategories.MACHINE_ENERGY_VALUES, new int[]{1000, 10000, 100000}, "Amount of energy each tier of Energy Laser Relay can transfer per tick (per side)."), - LASER_RELAY_ENERGY_LOSS_PERCENTAGE("Energy Laser Relay: Energy Loss Percentage Per Tier", ConfigCategories.MACHINE_ENERGY_VALUES, new int[]{5, 8, 10}, "Energy loss in percents for each tier of Energy Laser Relays, if enabled."); + LASER_RELAY_ENERGY_LOSS_PERCENTAGE("Energy Laser Relay: Energy Loss Percentage Per Tier", ConfigCategories.MACHINE_ENERGY_VALUES, new int[]{5, 8, 10}, "Energy loss in percents for each tier of Energy Laser Relays, if enabled."), + CRUSHER_ENERGY_USE("Crusher: Energy Use Per Tier", ConfigCategories.MACHINE_RECIPE_COSTS, new int[]{40, 40}, "Amount of energy used by Crusher and Double Crusher per tick."), + CRUSHER_PROCESSING_TIME("Crusher: Processing Time Per Tier", ConfigCategories.MACHINE_RECIPE_COSTS, new int[]{100, 150}, "Time in ticks required to perform one operation in Crusher and Double Crusher."); public final String name; public final String category; 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 0a1925b5c..da3383d33 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,7 +89,9 @@ public enum ConfigIntValues{ POWERED_FURNACE_ENERGY_CAPACITY("Powered Furnace: Energy Capacity", ConfigCategories.MACHINE_ENERGY_VALUES, 30000, 1000, 1000000000, "Amount of energy Powered Furnace can store."), POWERED_FURNACE_ENERGY_RECEIVE("Powered Furnace: Energy Receive Rate", ConfigCategories.MACHINE_ENERGY_VALUES, 150, 1, 1000000000, "Amount of energy Powered Furnace can receive per tick."), POWERED_FURNACE_ENERGY_USE("Powered Furnace: Energy Use", ConfigCategories.MACHINE_RECIPE_COSTS, 25, 1, 1000000000, "Amount of energy Powered Furnace uses per tick."), - POWERED_FURNACE_PROCESSING_DURATION("Powered Furnace: Processing Time", ConfigCategories.MACHINE_RECIPE_COSTS, 80, 1, 72000, "Time in ticks required to smelt one item in Powered Furnace."); + POWERED_FURNACE_PROCESSING_DURATION("Powered Furnace: Processing Time", ConfigCategories.MACHINE_RECIPE_COSTS, 80, 1, 72000, "Time in ticks required to smelt one item in Powered Furnace."), + CRUSHER_ENERGY_CAPACITY("Crusher: Energy Capacity", ConfigCategories.MACHINE_ENERGY_VALUES, 60000, 1000, 1000000000, "Amount of energy Crusher and Double Crusher can store."), + CRUSHER_ENERGY_RECEIVE("Crusher: Energy Receive Rate", ConfigCategories.MACHINE_ENERGY_VALUES, 100, 1, 1000000000, "Amount of energy Crusher and Double Crusher can receive per tick."); public final String name; public final String category; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java index 268a14ad1..1b2b8c0b5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java @@ -12,6 +12,8 @@ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.mod.blocks.BlockFurnaceDouble; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntListValues; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; import de.ellpeck.actuallyadditions.mod.misc.SoundHandler; import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor; import de.ellpeck.actuallyadditions.mod.recipe.CrusherRecipeRegistry; @@ -35,8 +37,7 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto public static final int SLOT_INPUT_2 = 3; public static final int SLOT_OUTPUT_2_1 = 4; public static final int SLOT_OUTPUT_2_2 = 5; - public static final int ENERGY_USE = 40; - public final CustomEnergyStorage storage = new CustomEnergyStorage(60000, 100, 0); + public final CustomEnergyStorage storage = new CustomEnergyStorage(ConfigIntValues.CRUSHER_ENERGY_CAPACITY.getValue(), ConfigIntValues.CRUSHER_ENERGY_RECEIVE.getValue(), 0); public int firstCrushTime; public int secondCrushTime; public boolean isDouble; @@ -96,8 +97,9 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto boolean shouldPlaySound = false; + int energyUse = ConfigIntListValues.CRUSHER_ENERGY_USE.getValue()[this.isDouble ? 1 : 0]; if(canCrushOnFirst){ - if(this.storage.getEnergyStored() >= ENERGY_USE){ + if(this.storage.getEnergyStored() >= energyUse){ if(this.firstCrushTime%20 == 0){ shouldPlaySound = true; } @@ -106,7 +108,7 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto this.finishCrushing(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2); this.firstCrushTime = 0; } - this.storage.extractEnergyInternal(ENERGY_USE, false); + this.storage.extractEnergyInternal(energyUse, false); } crushed = true; } @@ -116,7 +118,7 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto if(this.isDouble){ if(canCrushOnSecond){ - if(this.storage.getEnergyStored() >= ENERGY_USE){ + if(this.storage.getEnergyStored() >= energyUse){ if(this.secondCrushTime%20 == 0){ shouldPlaySound = true; } @@ -125,7 +127,7 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto this.finishCrushing(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2); this.secondCrushTime = 0; } - this.storage.extractEnergyInternal(ENERGY_USE, false); + this.storage.extractEnergyInternal(energyUse, false); } crushed = true; } @@ -181,7 +183,8 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto } private int getMaxCrushTime(){ - return this.isDouble ? 150 : 100; + int[] processingTime = ConfigIntListValues.CRUSHER_PROCESSING_TIME.getValue(); + return processingTime[this.isDouble ? 1 : 0]; } public void finishCrushing(int theInput, int theFirstOutput, int theSecondOutput){