當前位置: 首頁>>代碼示例>>Java>>正文


Java Blocks.portal方法代碼示例

本文整理匯總了Java中net.minecraft.init.Blocks.portal方法的典型用法代碼示例。如果您正苦於以下問題:Java Blocks.portal方法的具體用法?Java Blocks.portal怎麽用?Java Blocks.portal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.init.Blocks的用法示例。


在下文中一共展示了Blocks.portal方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: func_150858_a

import net.minecraft.init.Blocks; //導入方法依賴的package包/類
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;
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:64,代碼來源:BlockPortal.java

示例2: func_150857_a

import net.minecraft.init.Blocks; //導入方法依賴的package包/類
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;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:5,代碼來源:BlockPortal.java

示例3: onUpdate

import net.minecraft.init.Blocks; //導入方法依賴的package包/類
@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();
   }
 
開發者ID:Kanbe-Kotori,項目名稱:ExtraAcC,代碼行數:65,代碼來源:EntityUpdraft.java


注:本文中的net.minecraft.init.Blocks.portal方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。