本文整理汇总了Java中org.bukkit.entity.LivingEntity.getLocation方法的典型用法代码示例。如果您正苦于以下问题:Java LivingEntity.getLocation方法的具体用法?Java LivingEntity.getLocation怎么用?Java LivingEntity.getLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.entity.LivingEntity
的用法示例。
在下文中一共展示了LivingEntity.getLocation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MobAI
import org.bukkit.entity.LivingEntity; //导入方法依赖的package包/类
public MobAI(LivingEntity e, MobData md) {
this.entity = e;
this.md = md;
this.nmsEntity = ((CraftEntity) entity).getHandle();
this.originalLoc = e.getLocation();
for (MobAttribute ma : md.attributes) {
switch (ma) {
case RANGED:
this.ranged = true;
if (this.rangeDistance < 10)
this.rangeDistance = 10;
break;
case PASSIVE:
this.aggressive = false;
break;
case RANDOMPASSIVE:
this.randomMovement = true;
this.aggressive = false;
break;
case ARROW1:
this.archer = true;
this.makeRanged(10, 1.0f, 10);
break;
case ARROW2:
this.archer = true;
this.makeRanged(12, 1.5f, 9);
break;
case ARROW3:
this.archer = true;
this.makeRanged(15, 1.8f, 8);
break;
case ARROW4:
this.archer = true;
this.makeRanged(20, 2.3f, 7);
break;
case ARROW5:
this.archer = true;
this.makeRanged(25, 2.5f, 6);
break;
case RAPID:
this.rapid = true;
break;
case HYPERGOLEM:
this.currentWalkSpeed = DEFAULT_WALK_SPEED * 2.3;
break;
case SLOW1:
this.currentWalkSpeed = DEFAULT_WALK_SPEED * 0.9;
break;
case SLOW2:
this.currentWalkSpeed = DEFAULT_WALK_SPEED * 0.8;
break;
case SLOW3:
this.currentWalkSpeed = DEFAULT_WALK_SPEED * 0.7;
break;
case FAST1:
this.currentWalkSpeed = DEFAULT_WALK_SPEED * 1.2;
break;
case FAST2:
this.currentWalkSpeed = DEFAULT_WALK_SPEED * 1.4;
break;
case FAST3:
this.currentWalkSpeed = DEFAULT_WALK_SPEED * 1.6;
break;
default:
break;
}
}
if (entity instanceof Villager) {
currentWalkSpeed = 0.45;
}
this.nearbyPlayers = new ArrayList<Player>();
}