From e5bdf252686c43d8b8da7ea734456bd27d914d00 Mon Sep 17 00:00:00 2001 From: Lizbeth Rika Date: Fri, 15 May 2015 23:27:47 +0100 Subject: [PATCH] Recipe, docs and Stone of Temperance support for the Terra Truncator. --- .../botania/common/crafting/ModCraftingRecipes.java | 9 +++++++++ .../item/equipment/tool/terrasteel/ItemTerraAxe.java | 8 ++++++-- .../java/vazkii/botania/common/lexicon/LexiconData.java | 4 ++++ src/main/java/vazkii/botania/common/lib/LibLexicon.java | 3 ++- src/main/resources/assets/botania/lang/en_US.lang | 7 ++++++- 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java index a95a13014..7fb8daa6e 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java @@ -259,6 +259,7 @@ public final class ModCraftingRecipes { public static IRecipe recipeTemperanceStone; public static IRecipe recipeIncenseStick; public static IRecipe recipeIncensePlate; + public static IRecipe recipeTerraAxe; public static void init() { // Lexicon Recipe @@ -1728,6 +1729,14 @@ public final class ModCraftingRecipes { 'S', new ItemStack(ModFluffBlocks.livingwoodSlab)); recipeIncensePlate = BotaniaAPI.getLatestAddedRecipe(); + // Terra Truncator Recipe + addOreDictRecipe(new ItemStack(ModItems.terraAxe), + "TTG", "TST", " S ", + 'T', LibOreDict.TERRA_STEEL, + 'G', new ItemStack(Blocks.glowstone), + 'S', LibOreDict.LIVINGWOOD_TWIG); + recipeTerraAxe = BotaniaAPI.getLatestAddedRecipe(); + // Storage Block Recipes addOreDictRecipe(new ItemStack(ModBlocks.storage, 1, 0), "III", "III", "III", diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java index 36ac4685f..820a8df79 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java @@ -29,6 +29,7 @@ import net.minecraftforge.common.util.ForgeDirection; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.item.ISequentialBreaker; import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.common.item.ItemTemperanceStone; import vazkii.botania.common.item.equipment.tool.ToolCommons; import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelAxe; import vazkii.botania.common.item.relic.ItemLokiRing; @@ -66,9 +67,12 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - return player.isSneaking() ? iconOff : iconOn; + return shouldBreak(player) ? iconOn : iconOff; } + public boolean shouldBreak(EntityPlayer player) { + return !player.isSneaking() && !ItemTemperanceStone.hasTemperanceActive(player); + } @Override public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) { @@ -88,7 +92,7 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker @Override public void breakOtherBlock(EntityPlayer player, ItemStack stack, int x, int y, int z, int originX, int originY, int originZ, int side) { - if(!player.isSneaking()) { + if(shouldBreak(player)) { ChunkCoordinates coords = new ChunkCoordinates(x, y, z); addBlockSwapper(player.worldObj, player, stack, coords, coords, 32, false, true, new ArrayList()); } diff --git a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java index f47a384ce..b63d86653 100644 --- a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java +++ b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java @@ -181,6 +181,7 @@ public final class LexiconData { public static LexiconEntry livingwoodBow; public static LexiconEntry crystalBow; public static LexiconEntry temperanceStone; + public static LexiconEntry terraAxe; public static LexiconEntry enderAir; public static LexiconEntry enderEyeBlock; @@ -694,6 +695,9 @@ public final class LexiconData { temperanceStone = new BLexiconEntry(LibLexicon.TOOL_TEMPERANCE_STONE, categoryTools); temperanceStone.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeTemperanceStone)); + terraAxe = new BLexiconEntry(LibLexicon.TOOL_TERRA_AXE, categoryTools); + terraAxe.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeTerraAxe)); + // ENDER ENTRIES enderAir = new BLexiconEntry(LibLexicon.ENDER_AIR, categoryEnder); enderAir.setPriority().setLexiconPages(new PageText("0")); diff --git a/src/main/java/vazkii/botania/common/lib/LibLexicon.java b/src/main/java/vazkii/botania/common/lib/LibLexicon.java index d9289d6cd..84a0023ae 100644 --- a/src/main/java/vazkii/botania/common/lib/LibLexicon.java +++ b/src/main/java/vazkii/botania/common/lib/LibLexicon.java @@ -153,7 +153,8 @@ public final class LibLexicon { public static final String TOOL_LIVINGWOOD_BOW = "livingwoodBow"; public static final String TOOL_CRYSTAL_BOW = "crystalBow"; public static final String TOOL_TEMPERANCE_STONE = "temperanceStone"; - + public static final String TOOL_TERRA_AXE = "terraAxe"; + public static final String ENDER_AIR = "enderAir"; public static final String ENDER_ENDER_EYE_BLOCK = "enderEyeBlock"; public static final String ENDER_PISTON_RELAY = "pistonRelay"; diff --git a/src/main/resources/assets/botania/lang/en_US.lang b/src/main/resources/assets/botania/lang/en_US.lang index ff1814ddb..7f1c64828 100644 --- a/src/main/resources/assets/botania/lang/en_US.lang +++ b/src/main/resources/assets/botania/lang/en_US.lang @@ -2275,9 +2275,14 @@ botania.page.crystalBow1=The elves are roving # -- STONE OF TEMPERANCE botania.entry.temperanceStone=Stone of Temperance -botania.page.temperanceStone0=The &1Terra Shatterer&0 is able to destroy huge tracts of land when charged to its maximum potential, however, this might not always be the user's intent. A small, 3x3 tunnel might be more fitting in some cases. Having an active &1Stone of Temperance&0 in one's inventory will prevent their shatterer from breaking any more than a 3x3 area. The stone can be toggled on and off by shift-right clicking. +botania.page.temperanceStone0=The &1Terra Shatterer&0 is able to destroy huge tracts of land when charged to its maximum potential, however, this might not always be the user's intent. A small, 3x3 tunnel might be more fitting in some cases. Having an active &1Stone of Temperance&0 in one's inventory will prevent their shatterer from breaking any more than a 3x3 area. This also affects the &1Terra Truncator&0. The stone can be toggled on and off by shift-right clicking. botania.page.temperanceStone1=Don't lose it +# -- TERRA TRUNCATOR +botania.entry.terraAxe=Terra Truncator +botania.page.terraAxe0=The &1Terra Truncator&0 is a greataxe of premium quality achievable only with &1Terrasteel&0. When hitting a tree it'll take the whole thing down with speed, bringing all the logs and leaves along with it. Of course, this comes at a hefty cost of &4Mana&0.
This effect doesn't happen while sneaking or if the user has a &1Stone of Temperance&0. +botania.page.terraAxe1=It's not a Dead END + # - ENDER ARTEFACTS # -- EXTRACTING ENDER AIR botania.entry.enderAir=Extracting Ender Air