mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-26 06:52:58 +00:00
Botanurgist's Inkwell.
This commit is contained in:
1 parent
f287c5fd13
commit
ae73299d8b
13 files changed
+168
-8
No files matched your search
@@ -60,7 +60,9 @@ public interface IManaItem {
|
||||
public boolean canExportManaToItem(ItemStack stack, ItemStack otherStack);
|
||||
|
||||
/**
|
||||
* If this item simply does not export mana in any have, set this to true.
|
||||
* If this item simply does not export mana at all, set this to true. This is
|
||||
* used to skip items that contain mana but can't export it when drawing the
|
||||
* mana bar above the XP bar.
|
||||
*/
|
||||
public boolean isNoExport(ItemStack stack);
|
||||
|
||||
|
||||
@@ -83,6 +83,8 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.diviningRod);
|
||||
addItem(ModItems.gravityRod);
|
||||
addItem(ModItems.virus);
|
||||
if(Botania.thaumcraftLoaded)
|
||||
addItem(ModItems.manaInkwell);
|
||||
addItem(ModItems.slingshot);
|
||||
addItem(ModItems.vineBall);
|
||||
addItem(ModItems.regenIvy);
|
||||
|
||||
@@ -17,17 +17,14 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.common.item.equipment.armor.elementium.ItemElementiumBoots;
|
||||
import vazkii.botania.common.item.equipment.armor.elementium.ItemElementiumChest;
|
||||
import vazkii.botania.common.item.equipment.armor.elementium.ItemElementiumHelm;
|
||||
import vazkii.botania.common.item.equipment.armor.elementium.ItemElementiumHelmRevealing;
|
||||
import vazkii.botania.common.item.equipment.armor.elementium.ItemElementiumLegs;
|
||||
import vazkii.botania.common.item.equipment.armor.manasteel.ItemManasteelBoots;
|
||||
import vazkii.botania.common.item.equipment.armor.manasteel.ItemManasteelChest;
|
||||
import vazkii.botania.common.item.equipment.armor.manasteel.ItemManasteelHelm;
|
||||
import vazkii.botania.common.item.equipment.armor.manasteel.ItemManasteelHelmRevealing;
|
||||
import vazkii.botania.common.item.equipment.armor.manasteel.ItemManasteelLegs;
|
||||
import vazkii.botania.common.item.equipment.armor.terrasteel.ItemTerrasteelBoots;
|
||||
import vazkii.botania.common.item.equipment.armor.terrasteel.ItemTerrasteelChest;
|
||||
import vazkii.botania.common.item.equipment.armor.terrasteel.ItemTerrasteelHelm;
|
||||
import vazkii.botania.common.item.equipment.armor.terrasteel.ItemTerrasteelHelmRevealing;
|
||||
import vazkii.botania.common.item.equipment.armor.terrasteel.ItemTerrasteelLegs;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemAuraRing;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemDivaCharm;
|
||||
@@ -63,6 +60,10 @@ import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelPick;
|
||||
import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelShears;
|
||||
import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelShovel;
|
||||
import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelSword;
|
||||
import vazkii.botania.common.item.interaction.thaumcraft.ItemElementiumHelmRevealing;
|
||||
import vazkii.botania.common.item.interaction.thaumcraft.ItemManaInkwell;
|
||||
import vazkii.botania.common.item.interaction.thaumcraft.ItemManasteelHelmRevealing;
|
||||
import vazkii.botania.common.item.interaction.thaumcraft.ItemTerrasteelHelmRevealing;
|
||||
import vazkii.botania.common.lib.LibOreDict;
|
||||
|
||||
public final class ModItems {
|
||||
@@ -154,6 +155,7 @@ public final class ModItems {
|
||||
public static Item diviningRod;
|
||||
public static Item gravityRod;
|
||||
public static Item regenIvy;
|
||||
public static Item manaInkwell;
|
||||
|
||||
public static void init() {
|
||||
lexicon = new ItemLexicon();
|
||||
@@ -243,6 +245,7 @@ public final class ModItems {
|
||||
diviningRod = new ItemDiviningRod();
|
||||
gravityRod = new ItemGravityRod();
|
||||
regenIvy = new ItemRegenIvy();
|
||||
manaInkwell = new ItemManaInkwell();
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
|
||||
for(int i = 0; i < 16; i++) {
|
||||
|
||||
+2
-1
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* File Created @ [Jul 28, 2014, 6:16:24 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.equipment.armor.elementium;
|
||||
package vazkii.botania.common.item.interaction.thaumcraft;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.item.ItemStack;
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.item.equipment.armor.elementium.ItemElementiumHelm;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
/**
|
||||
* 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 26, 2014, 5:39:07 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.interaction.thaumcraft;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.IScribeTools;
|
||||
import vazkii.botania.api.mana.IManaItem;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.item.ItemMod;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IScribeTools")
|
||||
public class ItemManaInkwell extends ItemMod implements IManaItem, IScribeTools {
|
||||
|
||||
private static final int COST_PER_USE = 50;
|
||||
private static final int USES = 150;
|
||||
protected static final int MAX_MANA = COST_PER_USE * USES;
|
||||
|
||||
private static final String TAG_MANA = "mana";
|
||||
|
||||
public ItemManaInkwell() {
|
||||
setUnlocalizedName(LibItemNames.MANA_INKWELL);
|
||||
setMaxDamage(USES);
|
||||
setMaxStackSize(1);
|
||||
setNoRepair();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamage(ItemStack stack) {
|
||||
float mana = getMana(stack);
|
||||
return USES - (int) (mana / getMaxMana(stack) * USES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDamage(ItemStack stack, int damage) {
|
||||
int currentDamage = stack.getItemDamage();
|
||||
if(damage > currentDamage) {
|
||||
int cost = (damage - currentDamage) * COST_PER_USE;
|
||||
int mana = getMana(stack);
|
||||
if(mana >= cost) {
|
||||
addMana(stack, -cost);
|
||||
return;
|
||||
}
|
||||
}
|
||||
super.setDamage(stack, damage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisplayDamage(ItemStack stack) {
|
||||
return getDamage(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEntityLifespan(ItemStack itemStack, World world) {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
public static void setMana(ItemStack stack, int mana) {
|
||||
ItemNBTHelper.setInt(stack, TAG_MANA, mana);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMana(ItemStack stack) {
|
||||
return ItemNBTHelper.getInt(stack, TAG_MANA, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMana(ItemStack stack) {
|
||||
return MAX_MANA;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addMana(ItemStack stack, int mana) {
|
||||
setMana(stack, Math.min(getMana(stack) + mana, getMaxMana(stack)));
|
||||
stack.setItemDamage(getDamage(stack));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveManaFromPool(ItemStack stack, TileEntity pool) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveManaFromItem(ItemStack stack, ItemStack otherStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExportManaToPool(ItemStack stack, TileEntity pool) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExportManaToItem(ItemStack stack, ItemStack otherStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNoExport(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
+2
-1
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* File Created @ [Jul 28, 2014, 6:18:05 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.equipment.armor.manasteel;
|
||||
package vazkii.botania.common.item.interaction.thaumcraft;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.item.ItemStack;
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.item.equipment.armor.manasteel.ItemManasteelHelm;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
|
||||
+2
-1
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* File Created @ [Jul 28, 2014, 6:22:51 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.equipment.armor.terrasteel;
|
||||
package vazkii.botania.common.item.interaction.thaumcraft;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.item.ItemStack;
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.item.equipment.armor.terrasteel.ItemTerrasteelHelm;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
|
||||
@@ -100,6 +100,7 @@ public final class LibItemNames {
|
||||
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 MANA_INKWELL = "manaInkwell";
|
||||
|
||||
public static final String[] LENS_NAMES = new String[] {
|
||||
"lensNormal",
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package thaumcraft.api;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Azanor
|
||||
*
|
||||
* Interface used to identify scribing tool items used in research table
|
||||
*
|
||||
*/
|
||||
|
||||
public interface IScribeTools {
|
||||
|
||||
}
|
||||
+1
-1
@@ -22,7 +22,7 @@ group= "vazkii.botania" // http://maven.apache.org/guides/mini/guide-naming-conv
|
||||
archivesBaseName = "modid"
|
||||
|
||||
minecraft {
|
||||
version = "1.7.10-10.13.0.1187"
|
||||
version = "1.7.10-10.13.1.1217"
|
||||
assetDir = "eclipse/assets"
|
||||
}
|
||||
|
||||
|
||||
@@ -714,6 +714,7 @@ 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
|
||||
item.botania:manaInkwell.name=Botanurgist's Inkwell
|
||||
|
||||
# GUI TEXT
|
||||
botania.gui.lexicon.header=Lexica Botania, %s Edition Table of Contents
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"animation": {
|
||||
"frames": [
|
||||
{
|
||||
"index": 0,
|
||||
"time": 4
|
||||
}, {
|
||||
"index": 1,
|
||||
"time": 4
|
||||
}, {
|
||||
"index": 2,
|
||||
"time": 4
|
||||
}, {
|
||||
"index": 3,
|
||||
"time": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user