本文整理匯總了Java中org.bukkit.entity.ArmorStand.getLocation方法的典型用法代碼示例。如果您正苦於以下問題:Java ArmorStand.getLocation方法的具體用法?Java ArmorStand.getLocation怎麽用?Java ArmorStand.getLocation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.entity.ArmorStand
的用法示例。
在下文中一共展示了ArmorStand.getLocation方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: AbstractAmo
import org.bukkit.entity.ArmorStand; //導入方法依賴的package包/類
public AbstractAmo(int range, int damages, Vector direction, GamePlayer owner, WeaponType type) {
RANGE = range;
DAMAGES = damages;
COLOR = owner.getTeamColor();
OWNER = owner;
armorStand = (ArmorStand) owner.getPlayer().getWorld().spawnEntity(owner.getPlayer().getEyeLocation(), EntityType.ARMOR_STAND);
armorStand.setVisible(false);
int r = 20;
if(type == WeaponType.SHOOTER) r = 4;
if(type == WeaponType.SNIPER) r = 2;
double rng = (double) RANGE / r;
if(rng > 5) rng = 5;
armorStand.setVelocity(direction.multiply(rng));
lastLocation = armorStand.getLocation();
onFire(owner.getPlayer().getLocation());
task = Bukkit.getScheduler().runTaskTimer(Absorption.get(), new Runnable() {
@Override
public void run() {
check();
play(armorStand.getLocation());
}
}, 2, 1);
}