001package net.minecraft.entity.monster;
002
003import cpw.mods.fml.relauncher.Side;
004import cpw.mods.fml.relauncher.SideOnly;
005import net.minecraft.entity.Entity;
006import net.minecraft.entity.EntityLiving;
007import net.minecraft.potion.Potion;
008import net.minecraft.potion.PotionEffect;
009import net.minecraft.world.World;
010
011public class EntityCaveSpider extends EntitySpider
012{
013    public EntityCaveSpider(World par1World)
014    {
015        super(par1World);
016        this.texture = "/mob/cavespider.png";
017        this.setSize(0.7F, 0.5F);
018    }
019
020    public int getMaxHealth()
021    {
022        return 12;
023    }
024
025    @SideOnly(Side.CLIENT)
026
027    /**
028     * How large the spider should be scaled.
029     */
030    public float spiderScaleAmount()
031    {
032        return 0.7F;
033    }
034
035    public boolean attackEntityAsMob(Entity par1Entity)
036    {
037        if (super.attackEntityAsMob(par1Entity))
038        {
039            if (par1Entity instanceof EntityLiving)
040            {
041                byte b0 = 0;
042
043                if (this.worldObj.difficultySetting > 1)
044                {
045                    if (this.worldObj.difficultySetting == 2)
046                    {
047                        b0 = 7;
048                    }
049                    else if (this.worldObj.difficultySetting == 3)
050                    {
051                        b0 = 15;
052                    }
053                }
054
055                if (b0 > 0)
056                {
057                    ((EntityLiving)par1Entity).addPotionEffect(new PotionEffect(Potion.poison.id, b0 * 20, 0));
058                }
059            }
060
061            return true;
062        }
063        else
064        {
065            return false;
066        }
067    }
068
069    /**
070     * Initialize this creature.
071     */
072    public void initCreature() {}
073}