-
Notifications
You must be signed in to change notification settings - Fork 79
/
ItemBitSaw.java
55 lines (45 loc) · 1.25 KB
/
ItemBitSaw.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
package mod.chiselsandbits.items;
import java.util.List;
import mod.chiselsandbits.core.ChiselsAndBits;
import mod.chiselsandbits.localization.LocalStrings;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ItemBitSaw extends Item
{
public ItemBitSaw()
{
setMaxStackSize( 1 );
final int uses = ChiselsAndBits.getConfig().diamondSawUses;
setMaxDamage( ChiselsAndBits.getConfig().damageTools ? (int) Math.max( 0, uses ) : 0 );
}
@Override
@SideOnly( Side.CLIENT )
public void addInformation(
final ItemStack stack,
final World worldIn,
final List<String> tooltip,
final ITooltipFlag advanced )
{
super.addInformation( stack, worldIn, tooltip, advanced );
ChiselsAndBits.getConfig().helpText( LocalStrings.HelpBitSaw, tooltip );
}
@Override
public ItemStack getContainerItem(
final ItemStack itemStack )
{
if ( ChiselsAndBits.getConfig().damageTools )
{
itemStack.setItemDamage( itemStack.getItemDamage() + 1 );
}
return itemStack.copy();
}
@Override
public boolean hasContainerItem()
{
return true;
}
}