mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
Added the Timeless Ivy.
This commit is contained in:
1 parent
966efbe43c
commit
680f5829c8
7 files changed
+142
-1
No files matched your search
@@ -11,6 +11,8 @@
|
||||
*/
|
||||
package vazkii.botania.client.core.handler;
|
||||
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.item.ItemRegenIvy;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.StatCollector;
|
||||
@@ -27,6 +29,9 @@ public final class TooltipHandler {
|
||||
event.toolTip.add(StatCollector.translateToLocal("botaniamisc.coarseDirt1"));
|
||||
} else if(event.itemStack.getItem() == Item.getItemFromBlock(Blocks.mob_spawner) && event.entityPlayer.capabilities.isCreativeMode)
|
||||
event.toolTip.add(StatCollector.translateToLocal("botaniamisc.spawnerTip"));
|
||||
|
||||
if(ItemNBTHelper.getBoolean(event.itemStack, ItemRegenIvy.TAG_REGEN, false))
|
||||
event.toolTip.add(StatCollector.translateToLocal("botaniamisc.hasIvy"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -85,6 +85,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.virus);
|
||||
addItem(ModItems.slingshot);
|
||||
addItem(ModItems.vineBall);
|
||||
addItem(ModItems.regenIvy);
|
||||
addBlock(ModBlocks.forestDrum);
|
||||
addBlock(ModBlocks.forestEye);
|
||||
addBlock(ModBlocks.enderEye);
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Sep 3, 2014, 6:54:18 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.item.ItemRegenIvy;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
|
||||
public class RegenIvyRecipe implements IRecipe {
|
||||
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting var1, World var2) {
|
||||
ItemStack tool = null;
|
||||
boolean foundIvy = false;
|
||||
int materialsFound = 0;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
if(stack != null) {
|
||||
Item item = stack.getItem();
|
||||
if(item.isRepairable())
|
||||
tool = stack;
|
||||
|
||||
else if(stack.getItem() == ModItems.regenIvy)
|
||||
foundIvy = true;
|
||||
|
||||
else if(tool != null && tool.getItem().getIsRepairable(tool, stack))
|
||||
materialsFound++;
|
||||
|
||||
else return false; // Found an invalid item, breaking the recipe
|
||||
}
|
||||
}
|
||||
|
||||
return tool != null && foundIvy && materialsFound == 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting var1) {
|
||||
ItemStack tool = null;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
if(stack != null && stack.getItem().isDamageable())
|
||||
tool = stack;
|
||||
}
|
||||
|
||||
if(tool == null)
|
||||
return null;
|
||||
|
||||
ItemStack toolCopy = tool.copy();
|
||||
ItemNBTHelper.setBoolean(toolCopy, ItemRegenIvy.TAG_REGEN, true);
|
||||
return toolCopy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Sep 3, 2014, 6:31:10 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.RecipeSorter.Category;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.crafting.recipe.RegenIvyRecipe;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class ItemRegenIvy extends ItemMod {
|
||||
|
||||
public static final String TAG_REGEN = "Botania_regenIvy";
|
||||
private static final int MANA_PER_DAMAGE = 200;
|
||||
|
||||
public ItemRegenIvy() {
|
||||
setUnlocalizedName(LibItemNames.REGEN_IVY);
|
||||
GameRegistry.addRecipe(new RegenIvyRecipe());
|
||||
RecipeSorter.register("botania:regenIvy", RegenIvyRecipe.class, Category.SHAPELESS, "");
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTick(LivingUpdateEvent event) {
|
||||
if(event.entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) event.entity;
|
||||
for(int i = 0; i < player.inventory.getSizeInventory(); i++) {
|
||||
ItemStack stack = player.inventory.getStackInSlot(i);
|
||||
if(stack != null && ItemNBTHelper.detectNBT(stack) && ItemNBTHelper.getBoolean(stack, TAG_REGEN, false) && stack.getItemDamage() > 0 && ManaItemHandler.requestManaExact(stack, player, MANA_PER_DAMAGE, true))
|
||||
stack.setItemDamage(stack.getItemDamage() - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -153,6 +153,7 @@ public final class ModItems {
|
||||
public static Item sparkUpgrade;
|
||||
public static Item diviningRod;
|
||||
public static Item gravityRod;
|
||||
public static Item regenIvy;
|
||||
|
||||
public static void init() {
|
||||
lexicon = new ItemLexicon();
|
||||
@@ -241,7 +242,8 @@ public final class ModItems {
|
||||
sparkUpgrade = new ItemSparkUpgrade();
|
||||
diviningRod = new ItemDiviningRod();
|
||||
gravityRod = new ItemGravityRod();
|
||||
|
||||
regenIvy = new ItemRegenIvy();
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
|
||||
for(int i = 0; i < 16; i++) {
|
||||
OreDictionary.registerOre(LibOreDict.PETAL[i], new ItemStack(petal, 1, i));
|
||||
|
||||
@@ -99,6 +99,7 @@ public final class LibItemNames {
|
||||
public static final String SPARK_UPGRADE = "sparkUpgrade";
|
||||
public static final String DIVINING_ROD = "diviningRod";
|
||||
public static final String GRAVITY_ROD = "gravityRod";
|
||||
public static final String REGEN_IVY = "regenIvy";
|
||||
|
||||
public static final String[] LENS_NAMES = new String[] {
|
||||
"lensNormal",
|
||||
|
||||
@@ -48,6 +48,7 @@ botaniamisc.coarseDirt1=won't grow on it
|
||||
botaniamisc.spawnerTip=Tip: Use a Spawn Egg to change the mob
|
||||
botaniamisc.shardLevel=Shard Power %s
|
||||
botaniamisc.lexiconIndex=Lexicon Index
|
||||
botaniamisc.hasIvy=Has Timeless Ivy
|
||||
|
||||
# COLORS
|
||||
botania.color0=White
|
||||
@@ -706,6 +707,7 @@ item.botania:sparkUpgrade2.name=Spark Augment: Recessive
|
||||
item.botania:sparkUpgrade3.name=Spark Augment: Isolated
|
||||
item.botania:diviningRod.name=Rod of Divining
|
||||
item.botania:gravityRod.name=Rod of the Black Mesa
|
||||
item.botania:regenIvy.name=Timeless Ivy
|
||||
|
||||
# GUI TEXT
|
||||
botania.gui.lexicon.header=Lexica Botania, %s Edition Table of Contents
|
||||
|
||||
Reference in new issue
Block a user