本文整理汇总了Java中cn.nukkit.level.particle.SmokeParticle类的典型用法代码示例。如果您正苦于以下问题:Java SmokeParticle类的具体用法?Java SmokeParticle怎么用?Java SmokeParticle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SmokeParticle类属于cn.nukkit.level.particle包,在下文中一共展示了SmokeParticle类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onRun
import cn.nukkit.level.particle.SmokeParticle; //导入依赖的package包/类
@Override
public void onRun(int currentTick) {
int diff = currentTick - startAction;
double p = (double) diff / 20;
double f = Math.min((p * p + p * 2) / 3, 1) * 2;
Vector3 motion = new Vector3(
-Math.sin(player.yaw / 180d * Math.PI) * Math.cos(player.pitch / 180d * Math.PI),
-Math.sin(player.pitch / 180d * Math.PI),
Math.cos(player.yaw / 180d * Math.PI) * Math.cos(player.pitch / 180d * Math.PI)
).multiply(f);
Vector3 point = new Vector3(player.x, player.y + player.getEyeHeight(), player.z);
while (!player.level.getBlock(point).isSolid()) {
player.level.addParticle(new SmokeParticle(point), player);
// TODO: Find a new way that visible from long distance
motion.y -= 0.05f;
point.x += motion.x;
point.y += motion.y;
point.z += motion.z;
}
}
示例2: close
import cn.nukkit.level.particle.SmokeParticle; //导入依赖的package包/类
@Override
public void close() {
super.close();
if (linkedEntity instanceof Player) {
linkedEntity.riding = null;
linkedEntity = null;
}
SmokeParticle particle = new SmokeParticle(this);
level.addParticle(particle);
}
示例3: close
import cn.nukkit.level.particle.SmokeParticle; //导入依赖的package包/类
@Override
public void close() {
super.close();
if (this.linkedEntity instanceof Player) {
this.linkedEntity.riding = null;
}
SmokeParticle particle = new SmokeParticle(this);
this.level.addParticle(particle);
}
示例4: triggerLavaMixEffects
import cn.nukkit.level.particle.SmokeParticle; //导入依赖的package包/类
/**
* Creates fizzing sound and smoke. Used when lava flows over block or mixes with water.
*/
protected void triggerLavaMixEffects(Vector3 pos) {
this.getLevel().addSound(new FizzSound(pos.add(0.5, 0.5, 0.5), 2.6F + (ThreadLocalRandom.current().nextFloat() - ThreadLocalRandom.current().nextFloat()) * 0.8F));
for (int i = 0; i < 8; ++i) {
this.getLevel().addParticle(new SmokeParticle(pos.add(Math.random(), 1.2, Math.random())));
}
}