Java Code Examples for net.minecraft.entity.player.EntityPlayer.getEntityBoundingBox()

The following are Jave code examples for showing how to use getEntityBoundingBox() of the net.minecraft.entity.player.EntityPlayer class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: DecompiledMinecraft   File: EntityCloudFX.java   Source Code and License Vote up 5 votes
/**
 * Called to update the entity's position/logic.
 */
public void onUpdate()
{
    this.prevPosX = this.posX;
    this.prevPosY = this.posY;
    this.prevPosZ = this.posZ;

    if (this.particleAge++ >= this.particleMaxAge)
    {
        this.setDead();
    }

    this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge);
    this.moveEntity(this.motionX, this.motionY, this.motionZ);
    this.motionX *= 0.9599999785423279D;
    this.motionY *= 0.9599999785423279D;
    this.motionZ *= 0.9599999785423279D;
    EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, 2.0D);

    if (entityplayer != null && this.posY > entityplayer.getEntityBoundingBox().minY)
    {
        this.posY += (entityplayer.getEntityBoundingBox().minY - this.posY) * 0.2D;
        this.motionY += (entityplayer.motionY - this.motionY) * 0.2D;
        this.setPosition(this.posX, this.posY, this.posZ);
    }

    if (this.onGround)
    {
        this.motionX *= 0.699999988079071D;
        this.motionZ *= 0.699999988079071D;
    }
}
 
Example 2
Project: BaseClient   File: EntityCloudFX.java   Source Code and License Vote up 5 votes
/**
 * Called to update the entity's position/logic.
 */
public void onUpdate()
{
    this.prevPosX = this.posX;
    this.prevPosY = this.posY;
    this.prevPosZ = this.posZ;

    if (this.particleAge++ >= this.particleMaxAge)
    {
        this.setDead();
    }

    this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge);
    this.moveEntity(this.motionX, this.motionY, this.motionZ);
    this.motionX *= 0.9599999785423279D;
    this.motionY *= 0.9599999785423279D;
    this.motionZ *= 0.9599999785423279D;
    EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, 2.0D);

    if (entityplayer != null && this.posY > entityplayer.getEntityBoundingBox().minY)
    {
        this.posY += (entityplayer.getEntityBoundingBox().minY - this.posY) * 0.2D;
        this.motionY += (entityplayer.motionY - this.motionY) * 0.2D;
        this.setPosition(this.posX, this.posY, this.posZ);
    }

    if (this.onGround)
    {
        this.motionX *= 0.699999988079071D;
        this.motionZ *= 0.699999988079071D;
    }
}
 
Example 3
Project: BaseClient   File: EntityCloudFX.java   Source Code and License Vote up 5 votes
/**
 * Called to update the entity's position/logic.
 */
public void onUpdate()
{
    this.prevPosX = this.posX;
    this.prevPosY = this.posY;
    this.prevPosZ = this.posZ;

    if (this.particleAge++ >= this.particleMaxAge)
    {
        this.setDead();
    }

    this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge);
    this.moveEntity(this.motionX, this.motionY, this.motionZ);
    this.motionX *= 0.9599999785423279D;
    this.motionY *= 0.9599999785423279D;
    this.motionZ *= 0.9599999785423279D;
    EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, 2.0D);

    if (entityplayer != null && this.posY > entityplayer.getEntityBoundingBox().minY)
    {
        this.posY += (entityplayer.getEntityBoundingBox().minY - this.posY) * 0.2D;
        this.motionY += (entityplayer.motionY - this.motionY) * 0.2D;
        this.setPosition(this.posX, this.posY, this.posZ);
    }

    if (this.onGround)
    {
        this.motionX *= 0.699999988079071D;
        this.motionZ *= 0.699999988079071D;
    }
}
 
Example 4
Project: Backmemed   File: ParticleCloud.java   Source Code and License Vote up 5 votes
public void onUpdate()
{
    this.prevPosX = this.posX;
    this.prevPosY = this.posY;
    this.prevPosZ = this.posZ;

    if (this.particleAge++ >= this.particleMaxAge)
    {
        this.setExpired();
    }

    this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge);
    this.moveEntity(this.motionX, this.motionY, this.motionZ);
    this.motionX *= 0.9599999785423279D;
    this.motionY *= 0.9599999785423279D;
    this.motionZ *= 0.9599999785423279D;
    EntityPlayer entityplayer = this.worldObj.getClosestPlayer(this.posX, this.posY, this.posZ, 2.0D, false);

    if (entityplayer != null)
    {
        AxisAlignedBB axisalignedbb = entityplayer.getEntityBoundingBox();

        if (this.posY > axisalignedbb.minY)
        {
            this.posY += (axisalignedbb.minY - this.posY) * 0.2D;
            this.motionY += (entityplayer.motionY - this.motionY) * 0.2D;
            this.setPosition(this.posX, this.posY, this.posZ);
        }
    }

    if (this.isCollided)
    {
        this.motionX *= 0.699999988079071D;
        this.motionZ *= 0.699999988079071D;
    }
}
 
Example 5
Project: CustomWorldGen   File: ParticleCloud.java   Source Code and License Vote up 5 votes
public void onUpdate()
{
    this.prevPosX = this.posX;
    this.prevPosY = this.posY;
    this.prevPosZ = this.posZ;

    if (this.particleAge++ >= this.particleMaxAge)
    {
        this.setExpired();
    }

    this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge);
    this.moveEntity(this.motionX, this.motionY, this.motionZ);
    this.motionX *= 0.9599999785423279D;
    this.motionY *= 0.9599999785423279D;
    this.motionZ *= 0.9599999785423279D;
    EntityPlayer entityplayer = this.worldObj.getClosestPlayer(this.posX, this.posY, this.posZ, 2.0D, false);

    if (entityplayer != null)
    {
        AxisAlignedBB axisalignedbb = entityplayer.getEntityBoundingBox();

        if (this.posY > axisalignedbb.minY)
        {
            this.posY += (axisalignedbb.minY - this.posY) * 0.2D;
            this.motionY += (entityplayer.motionY - this.motionY) * 0.2D;
            this.setPosition(this.posX, this.posY, this.posZ);
        }
    }

    if (this.isCollided)
    {
        this.motionX *= 0.699999988079071D;
        this.motionZ *= 0.699999988079071D;
    }
}