package net.arsenalnetwork.arsenalmod.client.entities;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.Mod;
public class Zombies extends EntityZombie {
//Constructor
public Zombies(World worldIn) {
super(worldIn);
}
@Override
public void onLivingUpdate()
{
if (this.world.isDaytime() && !this.world.isRemote && !this.isChild() && this.shouldBurnInDay())
{
float f = this.getBrightness();
if (f > 0.5F && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.canSeeSky(new BlockPos(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ)))
{
boolean flag = true;
ItemStack itemstack = this.getItemStackFromSlot(EntityEquipmentSlot.HEAD);
if (!itemstack.isEmpty())
{
if (itemstack.isItemStackDamageable())
{
itemstack.setItemDamage(itemstack.getItemDamage() + this.rand.nextInt(2));
if (itemstack.getItemDamage() >= itemstack.getMaxDamage())
{
this.renderBrokenItemStack(itemstack);
this.setItemStackToSlot(EntityEquipmentSlot.HEAD, ItemStack.EMPTY);
}
}
flag = false;
}
if (flag)
{
this.setFire(8);
}
}
}
super.onLivingUpdate();
}
@Override
protected boolean shouldBurnInDay()
{
return false;
}
}