本文整理了Java中org.bukkit.entity.Entity.setFallDistance()
方法的一些代码示例,展示了Entity.setFallDistance()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.setFallDistance()
方法的具体详情如下:
包路径:org.bukkit.entity.Entity
类名称:Entity
方法名:setFallDistance
[英]Sets the fall distance for this entity
[中]设置此图元的下落距离
代码示例来源:origin: bergerkiller/BKCommonLib
@Override
public void setFallDistance(float arg0) {
base.setFallDistance(arg0);
}
代码示例来源:origin: EngineHub/CommandHelper
@Override
public void setFallDistance(float distance) {
e.setFallDistance(distance);
}
代码示例来源:origin: bergerkiller/BKCommonLib
public void setFallDistance(float arg0) {
entity.setFallDistance(arg0);
}
代码示例来源:origin: ProjectKorra/ProjectKorra
entity.setFallDistance(0);
代码示例来源:origin: ProjectKorra/ProjectKorra
private void deflect(final Entity entity) {
if (entity.getEntityId() == this.player.getEntityId()) {
return;
}
double x, z, vx, vz, mag;
double angle = 50;
angle = Math.toRadians(angle);
x = entity.getLocation().getX() - this.player.getLocation().getX();
z = entity.getLocation().getZ() - this.player.getLocation().getZ();
mag = Math.sqrt(x * x + z * z);
vx = (x * Math.cos(angle) - z * Math.sin(angle)) / mag;
vz = (x * Math.sin(angle) + z * Math.cos(angle)) / mag;
final Vector vec = new Vector(vx, 0, vz).normalize().multiply(this.push);
final Vector velocity = entity.getVelocity();
if (this.bPlayer.isAvatarState()) {
velocity.setX(AvatarState.getValue(vec.getX()));
velocity.setZ(AvatarState.getValue(vec.getZ()));
} else {
velocity.setX(vec.getX());
velocity.setZ(vec.getY());
}
GeneralMethods.setVelocity(entity, velocity);
entity.setFallDistance(0);
if (entity instanceof LivingEntity) {
final double damageDealt = this.getNightFactor(this.deflectDamage);
DamageHandler.damageEntity(entity, damageDealt, this);
AirAbility.breakBreathbendingHold(entity);
}
}
代码示例来源:origin: ProjectKorra/ProjectKorra
entity.setVelocity(this.vector);
new TempPotionEffect((LivingEntity) entity, effect);
entity.setFallDistance(0);
if (entity instanceof Creature) {
((Creature) entity).setTarget(null);
this.target.setFallDistance(0);
if (this.target instanceof Creature) {
((Creature) this.target).setTarget(null);
代码示例来源:origin: ProjectKorra/ProjectKorra
velocity.multiply(timefactor);
GeneralMethods.setVelocity(entity, velocity);
entity.setFallDistance(0);
代码示例来源:origin: ProjectKorra/ProjectKorra
dir.setY(dir.getY() * this.verticalPush);
entity.setVelocity(entity.getVelocity().clone().add(dir.clone().multiply(this.horizontalPush)));
entity.setFallDistance(0);
代码示例来源:origin: ProjectKorra/ProjectKorra
final Vector force = GeneralMethods.getDirection(entity.getLocation(), this.currentLoc);
entity.setVelocity(force.clone().normalize().multiply(this.speed));
entity.setFallDistance(0F);
代码示例来源:origin: ProjectKorra/ProjectKorra
GeneralMethods.setVelocity(entity, entity.getVelocity().clone().add(dir.clone().multiply(this.getNightFactor(this.pushFactor))));
entity.setFallDistance(0);
if (entity.getFireTicks() > 0) {
entity.getWorld().playEffect(entity.getLocation(), Effect.EXTINGUISH, 0);
代码示例来源:origin: ProjectKorra/ProjectKorra
entity.setFallDistance(0);
if (entity.getEntityId() != this.player.getEntityId() && entity instanceof Player) {
ProjectKorra.flightHandler.createInstance((Player) entity, this.player, 5000L, this.getName());
内容来源于网络,如有侵权,请联系作者删除!