-
Notifications
You must be signed in to change notification settings - Fork 754
/
Hatchet.java
113 lines (97 loc) · 2.51 KB
/
Hatchet.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
package tconstruct.items.tools;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import tconstruct.common.TRepo;
import tconstruct.library.tools.AbilityHelper;
import tconstruct.library.tools.HarvestTool;
import tconstruct.util.config.PHConstruct;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class Hatchet extends HarvestTool
{
public Hatchet()
{
super(3);
this.setUnlocalizedName("InfiTool.Axe");
}
@Override
protected Material[] getEffectiveMaterials ()
{
return materials;
}
@Override
protected String getHarvestType ()
{
return "axe";
}
@Override
public boolean onBlockDestroyed (ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase player)
{
if (block != null && block.getMaterial() == Material.leaves)
return false;
return AbilityHelper.onBlockChanged(itemstack, world, block, x, y, z, player, random);
}
static Material[] materials = { Material.wood, Material.leaves, Material.vine, Material.circuits, Material.cactus };//TODO find this//, Material.pumpkin };
@Override
public Item getHeadItem ()
{
return TRepo.hatchetHead;
}
@Override
public Item getAccessoryItem ()
{
return null;
}
@SideOnly(Side.CLIENT)
@Override
public int getRenderPasses (int metadata)
{
return 8;
}
@Override
public int getPartAmount ()
{
return 2;
}
@Override
public void registerPartPaths (int index, String[] location)
{
headStrings.put(index, location[0]);
brokenPartStrings.put(index, location[1]);
handleStrings.put(index, location[2]);
}
@Override
public String getIconSuffix (int partType)
{
switch (partType)
{
case 0:
return "_axe_head";
case 1:
return "_axe_head_broken";
case 2:
return "_axe_handle";
default:
return "";
}
}
@Override
public String getEffectSuffix ()
{
return "_axe_effect";
}
@Override
public String getDefaultFolder ()
{
return "axe";
}
@Override
public boolean isOffhandHandDualWeapon ()
{
return PHConstruct.isHatchetWeapon;
}
}