本文整理汇总了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;
}
}
示例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;
}
示例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();
}