本文整理汇总了Java中cn.nukkit.event.entity.EntityExplosionPrimeEvent类的典型用法代码示例。如果您正苦于以下问题:Java EntityExplosionPrimeEvent类的具体用法?Java EntityExplosionPrimeEvent怎么用?Java EntityExplosionPrimeEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EntityExplosionPrimeEvent类属于cn.nukkit.event.entity包,在下文中一共展示了EntityExplosionPrimeEvent类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: explode
import cn.nukkit.event.entity.EntityExplosionPrimeEvent; //导入依赖的package包/类
public void explode(double square) {
double root = Math.sqrt(square);
if (root > 5.0D) {
root = 5.0D;
}
EntityExplosionPrimeEvent event = new EntityExplosionPrimeEvent(this, (4.0D + new Random().nextDouble() * 1.5D * root));
server.getPluginManager().callEvent(event);
if (event.isCancelled()) {
return;
}
Explosion explosion = new Explosion(this, event.getForce(), this);
if (event.isBlockBreaking()) {
explosion.explodeA();
}
explosion.explodeB();
kill();
}
示例2: explode
import cn.nukkit.event.entity.EntityExplosionPrimeEvent; //导入依赖的package包/类
public void explode() {
EntityExplosionPrimeEvent event = new EntityExplosionPrimeEvent(this, 4);
server.getPluginManager().callEvent(event);
if (event.isCancelled()) {
return;
}
Explosion explosion = new Explosion(this, event.getForce(), this);
if (event.isBlockBreaking()) {
explosion.explodeA();
}
explosion.explodeB();
}
示例3: ExplosionPrimeEvent
import cn.nukkit.event.entity.EntityExplosionPrimeEvent; //导入依赖的package包/类
@EventHandler
public void ExplosionPrimeEvent(EntityExplosionPrimeEvent e){
e.setBlockBreaking(false);
}