mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-26 06:52:58 +00:00
Packets and Moss
This commit is contained in:
1 parent
7407d5af58
commit
37c88ce903
30 files changed
+575
-130
No files matched your search
@@ -334,6 +334,22 @@ public abstract class ToolCore extends Item
|
||||
{
|
||||
return TConstructContent.toolRod;
|
||||
}
|
||||
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5)
|
||||
{
|
||||
if (entity instanceof EntityLiving)
|
||||
{
|
||||
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
|
||||
if (tags.hasKey("Moss"))
|
||||
{
|
||||
int chance = tags.getInteger("Moss");
|
||||
if (random.nextInt(200) < chance)
|
||||
{
|
||||
AbilityHelper.damageTool(stack, -1, (EntityLiving)entity, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Tool uses */
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user