mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-14 01:04:16 +00:00
Added more Manasteel tools.
This commit is contained in:
1 parent
426131552f
commit
43360ef5c1
14 files changed
+439
-9
No files matched your search
@@ -49,7 +49,7 @@ public final class BotaniaAPI {
|
||||
public static Map<String, Integer> oreWeights = new HashMap<String, Integer>();
|
||||
|
||||
public static ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", 16, new int[]{ 2, 6, 5, 2 }, 18);
|
||||
// public static ToolMaterial a
|
||||
public static ToolMaterial manasteelToolMaterial = EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20);
|
||||
|
||||
static {
|
||||
registerSubTile("", DummySubTile.class);
|
||||
@@ -69,7 +69,7 @@ public final class BotaniaAPI {
|
||||
addOreWeight("oreDiamond", 1265); // Vanilla
|
||||
addOreWeight("oreEmerald", 780); // Vanilla
|
||||
addOreWeight("oreEmery", 415); // GregTech
|
||||
addOreWeight("oreGalena", 1000);
|
||||
addOreWeight("oreGalena", 1000); // Factorization
|
||||
addOreWeight("oreGold", 2970); // Vanilla
|
||||
addOreWeight("oreInfusedAir", 925); // Thaumcraft
|
||||
addOreWeight("oreInfusedEarth", 925); // Thaumcraft
|
||||
|
||||
@@ -73,6 +73,12 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addBlock(ModBlocks.unstableBlock);
|
||||
addBlock(ModBlocks.manaBeacon);
|
||||
addItem(ModItems.signalFlare);
|
||||
|
||||
addItem(ModItems.manasteelPick);
|
||||
addItem(ModItems.manasteelShovel);
|
||||
addItem(ModItems.manasteelAxe);
|
||||
addItem(ModItems.manasteelShears);
|
||||
addItem(ModItems.manasteelSword);
|
||||
addItem(ModItems.manasteelHelm);
|
||||
addItem(ModItems.manasteelChest);
|
||||
addItem(ModItems.manasteelLegs);
|
||||
|
||||
@@ -19,6 +19,11 @@ import vazkii.botania.common.item.magic.ItemDirtRod;
|
||||
import vazkii.botania.common.item.magic.ItemTerraformRod;
|
||||
import vazkii.botania.common.item.magic.ItemTimeRod;
|
||||
import vazkii.botania.common.item.tool.ItemManasteelArmor;
|
||||
import vazkii.botania.common.item.tool.ItemManasteelAxe;
|
||||
import vazkii.botania.common.item.tool.ItemManasteelPick;
|
||||
import vazkii.botania.common.item.tool.ItemManasteelShears;
|
||||
import vazkii.botania.common.item.tool.ItemManasteelShovel;
|
||||
import vazkii.botania.common.item.tool.ItemManasteelSword;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import vazkii.botania.common.lib.LibOreDict;
|
||||
|
||||
@@ -47,6 +52,11 @@ public final class ModItems {
|
||||
public static Item manasteelChest;
|
||||
public static Item manasteelLegs;
|
||||
public static Item manasteelBoots;
|
||||
public static Item manasteelPick;
|
||||
public static Item manasteelShovel;
|
||||
public static Item manasteelAxe;
|
||||
public static Item manasteelSword;
|
||||
public static Item manasteelShears;
|
||||
|
||||
public static void init() {
|
||||
lexicon = new ItemLexicon();
|
||||
@@ -72,7 +82,12 @@ public final class ModItems {
|
||||
manasteelChest = new ItemManasteelArmor(1, LibItemNames.MANASTEEL_CHEST);
|
||||
manasteelLegs = new ItemManasteelArmor(2, LibItemNames.MANASTEEL_LEGS);
|
||||
manasteelBoots = new ItemManasteelArmor(3, LibItemNames.MANASTEEL_BOOTS);
|
||||
|
||||
manasteelPick = new ItemManasteelPick();
|
||||
manasteelShovel = new ItemManasteelShovel();
|
||||
manasteelAxe = new ItemManasteelAxe();
|
||||
manasteelSword = new ItemManasteelSword();
|
||||
manasteelShears = new ItemManasteelShears();
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
|
||||
for(int i = 0; i < 16; i++) {
|
||||
OreDictionary.registerOre(LibOreDict.PETAL[i], new ItemStack(petal, 1, i));
|
||||
|
||||
@@ -65,12 +65,7 @@ public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor {
|
||||
|
||||
@Override
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
||||
int manaToRequest = damage * MANA_PER_DAMAGE;
|
||||
int manaRequested = entity instanceof EntityPlayer ? ManaItemHandler.requestMana(stack, (EntityPlayer) entity, manaToRequest, true) : 0;
|
||||
|
||||
int finalDamage = damage - manaRequested / MANA_PER_DAMAGE;
|
||||
if(finalDamage > 0)
|
||||
stack.damageItem(finalDamage, entity);
|
||||
ManasteelToolCommons.damageItem(stack, damage, entity, MANA_PER_DAMAGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* 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 @ [Apr 13, 2014, 7:15:39 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.tool;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemManasteelAxe extends ItemAxe {
|
||||
|
||||
private static final int MANA_PER_DAMAGE = 60;
|
||||
|
||||
public ItemManasteelAxe() {
|
||||
super(BotaniaAPI.manasteelToolMaterial);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setUnlocalizedName(LibItemNames.MANASTEEL_AXE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item setUnlocalizedName(String par1Str) {
|
||||
GameRegistry.registerItem(this, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) {
|
||||
ManasteelToolCommons.damageItem(par1ItemStack, 1, par3EntityLivingBase, MANA_PER_DAMAGE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entity) {
|
||||
if (block.getBlockHardness(world, x, y, z) != 0F)
|
||||
ManasteelToolCommons.damageItem(stack, 1, entity, MANA_PER_DAMAGE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* 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 @ [Apr 13, 2014, 7:05:58 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.tool;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemManasteelPick extends ItemPickaxe {
|
||||
|
||||
private static final int MANA_PER_DAMAGE = 60;
|
||||
|
||||
public ItemManasteelPick() {
|
||||
super(BotaniaAPI.manasteelToolMaterial);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setUnlocalizedName(LibItemNames.MANASTEEL_PICK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item setUnlocalizedName(String par1Str) {
|
||||
GameRegistry.registerItem(this, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) {
|
||||
ManasteelToolCommons.damageItem(par1ItemStack, 1, par3EntityLivingBase, MANA_PER_DAMAGE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entity) {
|
||||
if (block.getBlockHardness(world, x, y, z) != 0F)
|
||||
ManasteelToolCommons.damageItem(stack, 1, entity, MANA_PER_DAMAGE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
/**
|
||||
* 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 @ [Apr 13, 2014, 7:28:35 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.tool;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemShears;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
|
||||
public class ItemManasteelShears extends ItemShears {
|
||||
|
||||
private static final int MANA_PER_DAMAGE = 30;
|
||||
|
||||
public ItemManasteelShears() {
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setUnlocalizedName(LibItemNames.MANASTEEL_SHEARS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item setUnlocalizedName(String par1Str) {
|
||||
GameRegistry.registerItem(this, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity) {
|
||||
if(entity.worldObj.isRemote)
|
||||
return false;
|
||||
|
||||
if(entity instanceof IShearable) {
|
||||
IShearable target = (IShearable)entity;
|
||||
if(target.isShearable(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) {
|
||||
ArrayList<ItemStack> drops = target.onSheared(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
|
||||
|
||||
Random rand = new Random();
|
||||
for(ItemStack stack : drops) {
|
||||
EntityItem ent = entity.entityDropItem(stack, 1.0F);
|
||||
ent.motionY += rand.nextFloat() * 0.05F;
|
||||
ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
|
||||
ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
|
||||
}
|
||||
|
||||
ManasteelToolCommons.damageItem(itemstack, 1, player, MANA_PER_DAMAGE);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) {
|
||||
if (player.worldObj.isRemote)
|
||||
return false;
|
||||
|
||||
Block block = player.worldObj.getBlock(x, y, z);
|
||||
if(block instanceof IShearable) {
|
||||
IShearable target = (IShearable)block;
|
||||
if(target.isShearable(itemstack, player.worldObj, x, y, z)) {
|
||||
ArrayList<ItemStack> drops = target.onSheared(itemstack, player.worldObj, x, y, z, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
|
||||
Random rand = new Random();
|
||||
|
||||
for(ItemStack stack : drops) {
|
||||
float f = 0.7F;
|
||||
double d = rand.nextFloat() * f + (1D - f) * 0.5;
|
||||
double d1 = rand.nextFloat() * f + (1D - f) * 0.5;
|
||||
double d2 = rand.nextFloat() * f + (1D - f) * 0.5;
|
||||
|
||||
EntityItem entityitem = new EntityItem(player.worldObj, x + d, y + d1, z + d2, stack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
player.worldObj.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
|
||||
ManasteelToolCommons.damageItem(itemstack, 1, player, MANA_PER_DAMAGE);
|
||||
player.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(block)], 1);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* 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 @ [Apr 13, 2014, 7:14:54 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.tool;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemManasteelShovel extends ItemSpade {
|
||||
|
||||
private static final int MANA_PER_DAMAGE = 60;
|
||||
|
||||
public ItemManasteelShovel() {
|
||||
super(BotaniaAPI.manasteelToolMaterial);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setUnlocalizedName(LibItemNames.MANASTEEL_SHOVEL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item setUnlocalizedName(String par1Str) {
|
||||
GameRegistry.registerItem(this, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) {
|
||||
ManasteelToolCommons.damageItem(par1ItemStack, 1, par3EntityLivingBase, MANA_PER_DAMAGE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entity) {
|
||||
if (block.getBlockHardness(world, x, y, z) != 0F)
|
||||
ManasteelToolCommons.damageItem(stack, 1, entity, MANA_PER_DAMAGE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* 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 @ [Apr 13, 2014, 7:21:32 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.tool;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemManasteelSword extends ItemSword {
|
||||
|
||||
private static final int MANA_PER_DAMAGE = 50;
|
||||
|
||||
public ItemManasteelSword() {
|
||||
super(BotaniaAPI.manasteelToolMaterial);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setUnlocalizedName(LibItemNames.MANASTEEL_SWORD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item setUnlocalizedName(String par1Str) {
|
||||
GameRegistry.registerItem(this, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) {
|
||||
ManasteelToolCommons.damageItem(par1ItemStack, 1, par3EntityLivingBase, MANA_PER_DAMAGE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entity) {
|
||||
if (block.getBlockHardness(world, x, y, z) != 0F)
|
||||
ManasteelToolCommons.damageItem(stack, 1, entity, MANA_PER_DAMAGE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* 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 @ [Apr 13, 2014, 7:13:04 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.tool;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
|
||||
public final class ManasteelToolCommons {
|
||||
|
||||
public static void damageItem(ItemStack stack, int dmg, EntityLivingBase entity, int manaPerDamage) {
|
||||
int manaToRequest = dmg * manaPerDamage;
|
||||
int manaRequested = entity instanceof EntityPlayer ? ManaItemHandler.requestMana(stack, (EntityPlayer) entity, manaToRequest, true) : 0;
|
||||
|
||||
int finalDamage = dmg - manaRequested / manaPerDamage;
|
||||
if(finalDamage > 0)
|
||||
stack.damageItem(finalDamage, entity);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -38,6 +38,11 @@ public final class LibItemNames {
|
||||
public static final String MANASTEEL_CHEST = LibResources.PREFIX_MOD + "manasteelChest";
|
||||
public static final String MANASTEEL_LEGS = LibResources.PREFIX_MOD + "manasteelLegs";
|
||||
public static final String MANASTEEL_BOOTS = LibResources.PREFIX_MOD + "manasteelBoots";
|
||||
public static final String MANASTEEL_PICK = LibResources.PREFIX_MOD + "manasteelPick";
|
||||
public static final String MANASTEEL_SHOVEL = LibResources.PREFIX_MOD + "manasteelShovel";
|
||||
public static final String MANASTEEL_AXE = LibResources.PREFIX_MOD + "manasteelAxe";
|
||||
public static final String MANASTEEL_SWORD = LibResources.PREFIX_MOD + "manasteelSword";
|
||||
public static final String MANASTEEL_SHEARS = LibResources.PREFIX_MOD + "manasteelShears";
|
||||
|
||||
public static final String[] LENS_NAMES = new String[] {
|
||||
LibResources.PREFIX_MOD + "lensNormal",
|
||||
|
||||
@@ -265,6 +265,11 @@ item.botania:manasteelHelm.name=Manasteel Helm
|
||||
item.botania:manasteelChest.name=Manasteel Breastplate
|
||||
item.botania:manasteelLegs.name=Manasteel Platelegs
|
||||
item.botania:manasteelBoots.name=Manasteel Boots
|
||||
item.botania:manasteelPick.name=Manasteel Pick
|
||||
item.botania:manasteelShovel.name=Manasteel Spade
|
||||
item.botania:manasteelAxe.name=Manasteel Hatchet
|
||||
item.botania:manasteelSword.name=Manasteel Blade
|
||||
item.botania:manasteelShears.name=Manasteel Clippers
|
||||
|
||||
# GUI TEXT
|
||||
botania.gui.lexicon.header=Lexica Botania Index - Pick which category you would like to study:
|
||||
|
||||
File renamed without changes.
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
File renamed without changes.
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Reference in new issue
Block a user