Java Code Examples for net.minecraft.init.Blocks.portal()

The following are Jave code examples for showing how to use portal() of the net.minecraft.init.Blocks class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: DecompiledMinecraft   File: BlockPortal.java   View Source Code Vote up 4 votes
protected int func_150858_a()
{
    label24:

    for (this.field_150862_g = 0; this.field_150862_g < 21; ++this.field_150862_g)
    {
        for (int i = 0; i < this.field_150868_h; ++i)
        {
            BlockPos blockpos = this.field_150861_f.offset(this.field_150866_c, i).up(this.field_150862_g);
            Block block = this.world.getBlockState(blockpos).getBlock();

            if (!this.func_150857_a(block))
            {
                break label24;
            }

            if (block == Blocks.portal)
            {
                ++this.field_150864_e;
            }

            if (i == 0)
            {
                block = this.world.getBlockState(blockpos.offset(this.field_150863_d)).getBlock();

                if (block != Blocks.obsidian)
                {
                    break label24;
                }
            }
            else if (i == this.field_150868_h - 1)
            {
                block = this.world.getBlockState(blockpos.offset(this.field_150866_c)).getBlock();

                if (block != Blocks.obsidian)
                {
                    break label24;
                }
            }
        }
    }

    for (int j = 0; j < this.field_150868_h; ++j)
    {
        if (this.world.getBlockState(this.field_150861_f.offset(this.field_150866_c, j).up(this.field_150862_g)).getBlock() != Blocks.obsidian)
        {
            this.field_150862_g = 0;
            break;
        }
    }

    if (this.field_150862_g <= 21 && this.field_150862_g >= 3)
    {
        return this.field_150862_g;
    }
    else
    {
        this.field_150861_f = null;
        this.field_150868_h = 0;
        this.field_150862_g = 0;
        return 0;
    }
}
 
Example 2
Project: DecompiledMinecraft   File: BlockPortal.java   View Source Code Vote up 4 votes
protected boolean func_150857_a(Block p_150857_1_)
{
    return p_150857_1_.blockMaterial == Material.air || p_150857_1_ == Blocks.fire || p_150857_1_ == Blocks.portal;
}
 
Example 3
Project: DecompiledMinecraft   File: BlockPortal.java   View Source Code Vote up 4 votes
protected int func_150858_a()
{
    label24:

    for (this.field_150862_g = 0; this.field_150862_g < 21; ++this.field_150862_g)
    {
        for (int i = 0; i < this.field_150868_h; ++i)
        {
            BlockPos blockpos = this.field_150861_f.offset(this.field_150866_c, i).up(this.field_150862_g);
            Block block = this.world.getBlockState(blockpos).getBlock();

            if (!this.func_150857_a(block))
            {
                break label24;
            }

            if (block == Blocks.portal)
            {
                ++this.field_150864_e;
            }

            if (i == 0)
            {
                block = this.world.getBlockState(blockpos.offset(this.field_150863_d)).getBlock();

                if (block != Blocks.obsidian)
                {
                    break label24;
                }
            }
            else if (i == this.field_150868_h - 1)
            {
                block = this.world.getBlockState(blockpos.offset(this.field_150866_c)).getBlock();

                if (block != Blocks.obsidian)
                {
                    break label24;
                }
            }
        }
    }

    for (int j = 0; j < this.field_150868_h; ++j)
    {
        if (this.world.getBlockState(this.field_150861_f.offset(this.field_150866_c, j).up(this.field_150862_g)).getBlock() != Blocks.obsidian)
        {
            this.field_150862_g = 0;
            break;
        }
    }

    if (this.field_150862_g <= 21 && this.field_150862_g >= 3)
    {
        return this.field_150862_g;
    }
    else
    {
        this.field_150861_f = null;
        this.field_150868_h = 0;
        this.field_150862_g = 0;
        return 0;
    }
}
 
Example 4
Project: DecompiledMinecraft   File: BlockPortal.java   View Source Code Vote up 4 votes
protected boolean func_150857_a(Block p_150857_1_)
{
    return p_150857_1_.blockMaterial == Material.air || p_150857_1_ == Blocks.fire || p_150857_1_ == Blocks.portal;
}
 
Example 5
Project: ExtraAcC   File: EntityUpdraft.java   View Source Code Vote up 4 votes
@Override
public void onUpdate() {

	this.lastTickPosX = this.posX;
	this.lastTickPosY = this.posY;
	this.lastTickPosZ = this.posZ;
	super.onUpdate();

	this.ticksExisted++;
	this.width += 0.02;
	this.height += 0.04;

	Vec3 currentPos = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
	Vec3 nextPos = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + 0.02, this.posZ + this.motionZ);
	MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(currentPos, nextPos);

	if (movingobjectposition != null) {
		if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && this.worldObj.getBlock(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ) == Blocks.portal) {
			this.setInPortal();
		}
		nextPos = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
	}

	AxisAlignedBB axisalignedbb = this.boundingBox.expand(this.width, this.height, this.width);
	List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, axisalignedbb.addCoord(this.motionX, 0, this.motionZ));
	EntityPlayer player = this.getOwner();

	for (Object o : list) {
		Entity entity = (Entity)o;
		if (entity == player) {
			continue;
		}
		entity.attackEntityFrom(DamageSource.causePlayerDamage(this.getOwner()).setProjectile(), getDamage(exp));
		//entity.setVelocity(this.motionX, 0.1, this.motionZ);
		//entity.isAirBorne = true;
		entity.addVelocity(this.motionX / 10, 0.02, this.motionZ / 10);
		entity.fallDistance = 0;
	}	

       this.posX = nextPos.xCoord;
       this.posY = nextPos.yCoord;
       this.posZ = nextPos.zCoord;

       float f2 = velocityDecreaseRate;
       if (this.isInWater()) {
           for (int i = 0; i < 4; ++i) {
               float f4 = 0.25F;
               this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f4, this.posY - this.motionY * (double)f4, this.posZ - this.motionZ * (double)f4, this.motionX, this.motionY, this.motionZ);
           }

           f2 = 0.8F;
       }

       this.motionX *= (double)f2;
       this.motionY *= (double)f2;
       this.motionZ *= (double)f2;
       
       this.setPosition(this.posX, this.posY, this.posZ);
       
       this.rotationYaw += 5;

       if (this.ticksExisted >= this.age)
       	this.setDead();
   }
 
Example 6
Project: BaseClient   File: BlockPortal.java   View Source Code Vote up 4 votes
protected int func_150858_a()
{
    label24:

    for (this.field_150862_g = 0; this.field_150862_g < 21; ++this.field_150862_g)
    {
        for (int i = 0; i < this.field_150868_h; ++i)
        {
            BlockPos blockpos = this.field_150861_f.offset(this.field_150866_c, i).up(this.field_150862_g);
            Block block = this.world.getBlockState(blockpos).getBlock();

            if (!this.func_150857_a(block))
            {
                break label24;
            }

            if (block == Blocks.portal)
            {
                ++this.field_150864_e;
            }

            if (i == 0)
            {
                block = this.world.getBlockState(blockpos.offset(this.field_150863_d)).getBlock();

                if (block != Blocks.obsidian)
                {
                    break label24;
                }
            }
            else if (i == this.field_150868_h - 1)
            {
                block = this.world.getBlockState(blockpos.offset(this.field_150866_c)).getBlock();

                if (block != Blocks.obsidian)
                {
                    break label24;
                }
            }
        }
    }

    for (int j = 0; j < this.field_150868_h; ++j)
    {
        if (this.world.getBlockState(this.field_150861_f.offset(this.field_150866_c, j).up(this.field_150862_g)).getBlock() != Blocks.obsidian)
        {
            this.field_150862_g = 0;
            break;
        }
    }

    if (this.field_150862_g <= 21 && this.field_150862_g >= 3)
    {
        return this.field_150862_g;
    }
    else
    {
        this.field_150861_f = null;
        this.field_150868_h = 0;
        this.field_150862_g = 0;
        return 0;
    }
}
 
Example 7
Project: BaseClient   File: BlockPortal.java   View Source Code Vote up 4 votes
protected boolean func_150857_a(Block p_150857_1_)
{
    return p_150857_1_.blockMaterial == Material.air || p_150857_1_ == Blocks.fire || p_150857_1_ == Blocks.portal;
}
 
Example 8
Project: BaseClient   File: BlockPortal.java   View Source Code Vote up 4 votes
protected int func_150858_a()
{
    label24:

    for (this.field_150862_g = 0; this.field_150862_g < 21; ++this.field_150862_g)
    {
        for (int i = 0; i < this.field_150868_h; ++i)
        {
            BlockPos blockpos = this.field_150861_f.offset(this.field_150866_c, i).up(this.field_150862_g);
            Block block = this.world.getBlockState(blockpos).getBlock();

            if (!this.func_150857_a(block))
            {
                break label24;
            }

            if (block == Blocks.portal)
            {
                ++this.field_150864_e;
            }

            if (i == 0)
            {
                block = this.world.getBlockState(blockpos.offset(this.field_150863_d)).getBlock();

                if (block != Blocks.obsidian)
                {
                    break label24;
                }
            }
            else if (i == this.field_150868_h - 1)
            {
                block = this.world.getBlockState(blockpos.offset(this.field_150866_c)).getBlock();

                if (block != Blocks.obsidian)
                {
                    break label24;
                }
            }
        }
    }

    for (int j = 0; j < this.field_150868_h; ++j)
    {
        if (this.world.getBlockState(this.field_150861_f.offset(this.field_150866_c, j).up(this.field_150862_g)).getBlock() != Blocks.obsidian)
        {
            this.field_150862_g = 0;
            break;
        }
    }

    if (this.field_150862_g <= 21 && this.field_150862_g >= 3)
    {
        return this.field_150862_g;
    }
    else
    {
        this.field_150861_f = null;
        this.field_150868_h = 0;
        this.field_150862_g = 0;
        return 0;
    }
}
 
Example 9
Project: BaseClient   File: BlockPortal.java   View Source Code Vote up 4 votes
protected boolean func_150857_a(Block p_150857_1_)
{
    return p_150857_1_.blockMaterial == Material.air || p_150857_1_ == Blocks.fire || p_150857_1_ == Blocks.portal;
}