/** summon enderman particles and play teleport sound (start / end configurable)*/
public static void ender(World world, double x, double y, double z, double tx, double ty, double tz, boolean sound2x) {
short nParticles = 64;
float width = 1;
float height = 2;
int dim = world.provider.getDimension();
for (int l = 0; l < nParticles; ++l)
{
double d6 = l / (nParticles - 1.0D);
float f = (random.nextFloat() - 0.5F) * 0.2F;
float f1 = (random.nextFloat() - 0.5F) * 0.2F;
float f2 = (random.nextFloat() - 0.5F) * 0.2F;
double d7 = tx + (x - tx) * d6 + (random.nextDouble() - 0.5D) * width * 2.0D;
double d8 = ty + (y - ty) * d6 + random.nextDouble() * height;
double d9 = tz + (z - tz) * d6 + (random.nextDouble() - 0.5D) * width * 2.0D;
LCNetwork.net.sendToAllAround(new MessageSpawnParticle("portal", d7, d8, d9, f, f1, f2), new TargetPoint(dim, d7, d8, d9, 1024));
}
float pitch = 0.9F + random.nextFloat() * 0.2F;
world.playSound(null, x , y, z, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.PLAYERS, 1.0F, pitch);
if(sound2x) world.playSound(null, tx , ty, tz, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.PLAYERS, 1.0F, pitch);
}
Effect.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:LightningCraft
作者:
评论列表
文章目录