From a7e63fc174729b3fd74f46d20ca54c84681f7e0b Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 1 Oct 2015 12:11:38 +0200 Subject: [PATCH] Leaf Generator booklet entry, crafting and localization --- .../actuallyadditions/booklet/InitBooklet.java | 1 + .../config/values/ConfigCrafting.java | 1 + .../config/values/ConfigIntValues.java | 6 +++++- .../actuallyadditions/crafting/BlockCrafting.java | 13 +++++++++++++ .../tile/TileEntityLeafGenerator.java | 7 ++++--- .../assets/actuallyadditions/lang/en_US.lang | 4 ++++ 6 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java b/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java index e20b08a99..e70d52d98 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java @@ -91,6 +91,7 @@ public class InitBooklet{ new BookletChapter("solarPanel", entryGeneratingRF, new ItemStack(InitBlocks.blockFurnaceSolar), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.FURNACE_SOLAR_ENERGY_PRODUCED.getValue()), new PageCrafting(2, BlockCrafting.recipeSolar).setNoText()); new BookletChapter("heatCollector", entryGeneratingRF, new ItemStack(InitBlocks.blockHeatCollector), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.HEAT_COLLECTOR_ENERGY_PRODUCED.getValue()).addTextReplacement("", ConfigIntValues.HEAT_COLLECTOR_BLOCKS.getValue()), new PageCrafting(2, BlockCrafting.recipeHeatCollector).setNoText()); new BookletChapter("canola", entryGeneratingRF, new ItemStack(InitBlocks.blockFermentingBarrel), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())).addTextReplacement("", ConfigIntValues.PRESS_ENERGY_USED.getValue()).addTextReplacement("", ConfigIntValues.PRESS_MB_PRODUCED.getValue()).addTextReplacement("", ConfigIntValues.OIL_GEN_ENERGY_PRODUCED.getValue()), new PageCrafting(2, BlockCrafting.recipeCanolaPress).setNoText(), new PageCrafting(3, BlockCrafting.recipeFermentingBarrel).setNoText(), new PageCrafting(4, BlockCrafting.recipeOilGen).setNoText()); + new BookletChapter("leafGen", entryGeneratingRF, new ItemStack(InitBlocks.blockLeafGenerator), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.LEAF_GENERATOR_ENERGY_PRODUCED.getValue()), new PageCrafting(2, BlockCrafting.recipeLeafGen)); //No RF Using Items new BookletChapter("wings", entryItemsNonRF, new ItemStack(InitItems.itemWingsOfTheBats), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BAT_WING.ordinal())), new PageCrafting(2, ItemCrafting.recipeWings).setNoText()); diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java index bc60eb646..4de143a6d 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java @@ -89,6 +89,7 @@ public enum ConfigCrafting{ CANOLA_PRESS("Canola Press", ConfigCategories.BLOCKS_CRAFTING), FERMENTING_BARREL("Fermenting Barrel", ConfigCategories.BLOCKS_CRAFTING), COAL_GENERATOR("Coal Generator", ConfigCategories.BLOCKS_CRAFTING), + LEAF_GENERATOR("Leaf Generator", ConfigCategories.BLOCKS_CRAFTING), OIL_GENERATOR("Oil Generator", ConfigCategories.BLOCKS_CRAFTING), PHANTOMFACE("Phantomface", ConfigCategories.BLOCKS_CRAFTING), PHANTOM_CONNECTOR("Phantom Connector", ConfigCategories.ITEMS_CRAFTING), diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java index 1ed672cde..493f42cbc 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java @@ -160,7 +160,11 @@ public enum ConfigIntValues{ ORE_MAGNET_MAX_TIMER("Ore Magnet: Max Timer", ConfigCategories.MACHINE_VALUES, 20, 1, 2000, "The approximate Time it takes for the Ore Magnet to search for a new block to mine"), ORE_MAGNET_RANGE("Ore Magnet: Range", ConfigCategories.MACHINE_VALUES, 10, 1, 60, "The range of the Ore Magnet"), ORE_MAGNET_OIL_USE("Ore Magnet: Oil Use", ConfigCategories.MACHINE_VALUES, 30, 0, 5000, "The amount of oil the Ore Magnet uses every Block"), - ORE_MAGNET_ENERGY_USE("Ore Magnet: Energy USe", ConfigCategories.MACHINE_VALUES, 250, 10, 10000, "The amount of Energy the Ore Magnet uses every tick"); + ORE_MAGNET_ENERGY_USE("Ore Magnet: Energy USe", ConfigCategories.MACHINE_VALUES, 250, 10, 10000, "The amount of Energy the Ore Magnet uses every tick"), + + LEAF_GENERATOR_ENERGY_PRODUCED("Leaf Generator: Energy Produce", ConfigCategories.MACHINE_VALUES, 20, 1, 10000, "How much Energy the Leaf Generator produces per Leaf broken"), + LEAF_GENERATOR_COOLDOWN_TIME("Leaf Generator: Cooldown Time", ConfigCategories.MACHINE_VALUES, 5, 0, 100, "The amount of ticks that it takes util another Leaf gets proken"), + LEAF_GENERATOR_RANGE("Leaf Generator: Range", ConfigCategories.MACHINE_VALUES, 5, 1, 100, "The radius of a leaf generator"); public final String name; public final String category; diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java index caf56a90d..77554dc71 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java @@ -73,6 +73,7 @@ public class BlockCrafting{ public static IRecipe recipeCanolaPress; public static IRecipe[] recipesLamps = new IRecipe[BlockColoredLamp.allLampTypes.length]; public static IRecipe recipePowerer; + public static IRecipe recipeLeafGen; public static void init(){ @@ -308,6 +309,18 @@ public class BlockCrafting{ recipeCoalGen = Util.lastIRecipe(); } + //Leaf Generator + if(ConfigCrafting.LEAF_GENERATOR.isEnabled()){ + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockLeafGenerator), + "IEI", "GLG", "ICI", + 'I', "ingotIron", + 'G', "ingotGold", + 'E', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.STONE_CASING.ordinal()), + 'L', "treeLeaves", + 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); + recipeLeafGen = Util.lastIRecipe(); + } + //Enderpearl Block GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal()), "EE", "EE", diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLeafGenerator.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLeafGenerator.java index 7c01e50e7..11d2308be 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLeafGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLeafGenerator.java @@ -12,6 +12,7 @@ package ellpeck.actuallyadditions.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyProvider; +import ellpeck.actuallyadditions.config.values.ConfigIntValues; import ellpeck.actuallyadditions.util.WorldPos; import ellpeck.actuallyadditions.util.WorldUtil; import net.minecraft.block.Block; @@ -32,14 +33,14 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr public void updateEntity(){ if(!worldObj.isRemote){ - if(this.nextUseCounter >= 5){ //TODO Config + if(this.nextUseCounter >= ConfigIntValues.LEAF_GENERATOR_COOLDOWN_TIME.getValue()){ this.nextUseCounter = 0; - int energyProducedPerLeaf = 20; //TODO Config + int energyProducedPerLeaf = ConfigIntValues.LEAF_GENERATOR_ENERGY_PRODUCED.getValue(); if(energyProducedPerLeaf <= this.storage.getMaxEnergyStored()-this.storage.getEnergyStored()){ ArrayList breakPositions = new ArrayList(); - int range = 5; //TODO Config + int range = ConfigIntValues.LEAF_GENERATOR_RANGE.getValue(); for(int reachX = -range; reachX < range+1; reachX++){ for(int reachZ = -range; reachZ < range+1; reachZ++){ for(int reachY = -range; reachY < range+1; reachY++){ diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index ae48133c6..1e0727b34 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -88,6 +88,7 @@ tile.actuallyadditions.blockFlax.name=Flax Plant tile.actuallyadditions.blockCoffeeMachine.name=Coffee Machine tile.actuallyadditions.blockXPSolidifier.name=Experience Solidifier tile.actuallyadditions.blockSmileyCloud.name=Smiley Cloud +tile.actuallyadditions.blockLeafGenerator.name=Leaf-Eating Generator #ESD tile.actuallyadditions.blockInputter.name=ESD @@ -527,3 +528,6 @@ booklet.actuallyadditions.chapter.waterRemovalRing.text.1=The Ring Of Liqu booklet.actuallyadditions.chapter.batteries.name=Batteries booklet.actuallyadditions.chapter.batteries.text.1=Batteries are a good way to store RF to move around. They can be charged in an Energizer and discharged in an Enervator. +booklet.actuallyadditions.chapter.leafGen.name=Leaf-Eating Generator +booklet.actuallyadditions.chapter.leafGen.text.1=The Leaf Generator can generate RF just by being placed alongside some Leaves. It will destroy the leaves, generating RF per leaf broken in the process. By right-clicking the generator, you can see how much RF it has stored. +booklet.actuallyadditions.chapter.leafGen.text.2=Munchy \ No newline at end of file