Packets and Moss

This commit is contained in:
mDiyo committed 2013-01-20 20:38:23 -08:00
1 parent 7407d5af58
commit 37c88ce903
30 files changed
+575 -130

No files matched your search

+16
View File
@@ -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