mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-14 01:04:16 +00:00
A little easter egg never hurt anybody.
This commit is contained in:
1 parent
50214ee3f2
commit
60796cd026
2 files changed
+18
-4
No files matched your search
@@ -17,6 +17,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
@@ -28,8 +29,10 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemManasteelSword extends ItemSword {
|
||||
|
||||
private static final int MANA_PER_DAMAGE = 50;
|
||||
|
||||
private static final int MANA_PER_DAMAGE = 50;
|
||||
|
||||
IIcon elucidatorIcon;
|
||||
|
||||
public ItemManasteelSword() {
|
||||
super(BotaniaAPI.manasteelToolMaterial);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
@@ -46,14 +49,25 @@ private static final int MANA_PER_DAMAGE = 50;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this);
|
||||
elucidatorIcon = IconHelper.forName(par1IconRegister, "elucidator");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) {
|
||||
ManasteelToolCommons.damageItem(par1ItemStack, 1, par3EntityLivingBase, MANA_PER_DAMAGE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconIndex(ItemStack par1ItemStack) {
|
||||
return par1ItemStack.getDisplayName().equals("The Elucidator") ? elucidatorIcon : super.getIconIndex(par1ItemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int pass) {
|
||||
return getIconIndex(stack);
|
||||
}
|
||||
|
||||
@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)
|
||||
@@ -61,5 +75,5 @@ private static final int MANA_PER_DAMAGE = 50;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
Reference in new issue
Block a user