本文整理汇总了Java中net.minecraft.entity.EntityLiving.spawnExplosionParticle方法的典型用法代码示例。如果您正苦于以下问题:Java EntityLiving.spawnExplosionParticle方法的具体用法?Java EntityLiving.spawnExplosionParticle怎么用?Java EntityLiving.spawnExplosionParticle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.EntityLiving
的用法示例。
在下文中一共展示了EntityLiving.spawnExplosionParticle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateSpawner
import net.minecraft.entity.EntityLiving; //导入方法依赖的package包/类
public void updateSpawner()
{
if (this.isActivated())
{
BlockPos blockpos = this.getSpawnerPosition();
if (this.getSpawnerWorld().isRemote)
{
double d3 = (double)((float)blockpos.getX() + this.getSpawnerWorld().rand.nextFloat());
double d4 = (double)((float)blockpos.getY() + this.getSpawnerWorld().rand.nextFloat());
double d5 = (double)((float)blockpos.getZ() + this.getSpawnerWorld().rand.nextFloat());
this.getSpawnerWorld().spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d3, d4, d5, 0.0D, 0.0D, 0.0D, new int[0]);
this.getSpawnerWorld().spawnParticle(EnumParticleTypes.FLAME, d3, d4, d5, 0.0D, 0.0D, 0.0D, new int[0]);
if (this.spawnDelay > 0)
{
--this.spawnDelay;
}
this.prevMobRotation = this.mobRotation;
this.mobRotation = (this.mobRotation + (double)(1000.0F / ((float)this.spawnDelay + 200.0F))) % 360.0D;
}
else
{
if (this.spawnDelay == -1)
{
this.resetTimer();
}
if (this.spawnDelay > 0)
{
--this.spawnDelay;
return;
}
boolean flag = false;
for (int i = 0; i < this.spawnCount; ++i)
{
Entity entity = EntityList.createEntityByName(this.getEntityNameToSpawn(), this.getSpawnerWorld());
if (entity == null)
{
return;
}
int j = this.getSpawnerWorld().getEntitiesWithinAABB(entity.getClass(), (new AxisAlignedBB((double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ(), (double)(blockpos.getX() + 1), (double)(blockpos.getY() + 1), (double)(blockpos.getZ() + 1))).expand((double)this.spawnRange, (double)this.spawnRange, (double)this.spawnRange)).size();
if (j >= this.maxNearbyEntities)
{
this.resetTimer();
return;
}
double d0 = (double)blockpos.getX() + (this.getSpawnerWorld().rand.nextDouble() - this.getSpawnerWorld().rand.nextDouble()) * (double)this.spawnRange + 0.5D;
double d1 = (double)(blockpos.getY() + this.getSpawnerWorld().rand.nextInt(3) - 1);
double d2 = (double)blockpos.getZ() + (this.getSpawnerWorld().rand.nextDouble() - this.getSpawnerWorld().rand.nextDouble()) * (double)this.spawnRange + 0.5D;
EntityLiving entityliving = entity instanceof EntityLiving ? (EntityLiving)entity : null;
entity.setLocationAndAngles(d0, d1, d2, this.getSpawnerWorld().rand.nextFloat() * 360.0F, 0.0F);
if (entityliving == null || entityliving.getCanSpawnHere() && entityliving.isNotColliding())
{
this.spawnNewEntity(entity, true);
this.getSpawnerWorld().playAuxSFX(2004, blockpos, 0);
if (entityliving != null)
{
entityliving.spawnExplosionParticle();
}
flag = true;
}
}
if (flag)
{
this.resetTimer();
}
}
}
}