本文整理汇总了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;
}
}
开发者ID:yescallop,项目名称:ShootingHelper,代码行数:21,代码来源:DrawBowTask.java
示例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);
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:13,代码来源:EntityMinecartAbstract.java
示例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);
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:12,代码来源:EntityBoat.java
示例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())));
}
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:11,代码来源:BlockLiquid.java
注:本文中的cn.nukkit.level.particle.SmokeParticle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论