// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode fieldsfirst 

package net.minecraft.server;


// Referenced classes of package net.minecraft.src:
//            Entity, MathHelper, World, NBTTagCompound

public class EntityKripkaverPrimed extends Entity
{

    public int fuse;

    public EntityKripkaverPrimed(World world)
    {
        super(world);
        fuse = 0;
        bf = true;
        b(0.98F, 0.98F);
        height = length / 2.0F;
    }

    public EntityKripkaverPrimed(World world, double d, double d1, double d2)
    {
        this(world);
        setPosition(d, d1, d2);
        float f = (float)(Math.random() * 3.1415927410125732D * 2D);
        motX = -MathHelper.sin((f * 3.141593F) / 180F) * 0.02F;
        motY = 0.20000000298023224D;
        motZ = -MathHelper.cos((f * 3.141593F) / 180F) * 0.02F;
        fuse = 80;
        lastX = d;
        lastY = d1;
        lastZ = d2;
    }

    protected void b()
    {
    }

    protected boolean g_()
    {
        return false;
    }

    public boolean e_()
    {
        return !dead;
    }

    public void w_()
    {
        lastX = locX;
        lastY = locY;
        lastZ = locZ;
        motY -= 0.039999999105930328D;
        move(motX, motY, motZ);
        motX *= 0.98000001907348633D;
        motY *= 0.98000001907348633D;
        motZ *= 0.98000001907348633D;
        if(onGround)
        {
            motX *= 0.69999998807907104D;
            motZ *= 0.69999998807907104D;
            motY *= -0.5D;
        }
        if(fuse-- <= 0)
        {
            if(!world.isStatic)
            {
                die();
                explode();
            } else
            {
                die();
            }
        } else
        {
            world.a("smoke", locX, locY + 0.5D, locZ, 0.0D, 0.0D, 0.0D);
        }
    }

    private void explode()
    {
        float f = 1.0F;
        world.a(null, locX, locY, locZ, f);
    }

    protected void b(NBTTagCompound nbttagcompound)
    {
        nbttagcompound.setByte("Fuse", (byte)fuse);
    }

    protected void a(NBTTagCompound nbttagcompound)
    {
        fuse = nbttagcompound.getByte("Fuse");
    }

    public float getShadowSize()
    {
        return 0.0F;
    }
}
