Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
1package net.minecraft.server;
2
3public class ItemTool extends Item {
4
5 private Block[] bk;
6 private float bl = 4.0F;
7 private int bm;
8 protected EnumToolMaterial a;
9
10 protected ItemTool(int i, int j, EnumToolMaterial enumtoolmaterial, Block[] ablock) {
11 super(i);
12 this.a = enumtoolmaterial;
13 this.bk = ablock;
14 this.maxStackSize = 1;
15 this.d(enumtoolmaterial.a());
16 this.bl = enumtoolmaterial.b();
17 this.bm = j + enumtoolmaterial.c();
18 }
19
20 public float a(ItemStack itemstack, Block block) {
21 for (int i = 0; i < this.bk.length; ++i) {
22 if (this.bk[i] == block) {
23 return this.bl;
24 }
25 }
26
27 return 1.0F;
28 }
29
30 public boolean a(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1) {
31 itemstack.damage(2, entityliving1);
32 return true;
33 }
34
35 public boolean a(ItemStack itemstack, int i, int j, int k, int l, EntityLiving entityliving) {
36 itemstack.damage(1, entityliving);
37 return true;
38 }
39
40 public int a(Entity entity) {
41 return this.bm;
42 }
43}