本文整理匯總了Java中org.bukkit.entity.Projectile.getLocation方法的典型用法代碼示例。如果您正苦於以下問題:Java Projectile.getLocation方法的具體用法?Java Projectile.getLocation怎麽用?Java Projectile.getLocation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.entity.Projectile
的用法示例。
在下文中一共展示了Projectile.getLocation方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: sendArrowParticle
import org.bukkit.entity.Projectile; //導入方法依賴的package包/類
public static void sendArrowParticle(Projectile arrow, float x, float y, float z) {
Location loc = arrow.getLocation();
PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(EnumParticle.REDSTONE, true,
(float)loc.getX(), (float)loc.getY(), (float)loc.getZ(), x, y, z, 1f, 0);
PacketUtils.broadcastPacketByUUID(packet, allArrows);
if (arrow.getShooter() instanceof Player && selfArrows.contains(((Player) arrow.getShooter()).getUniqueId()))
PacketUtils.sendPacket((Player) arrow.getShooter(), packet);
}
示例2: doEffect
import org.bukkit.entity.Projectile; //導入方法依賴的package包/類
private void doEffect(Projectile projectile, String effect) {
World world = projectile.getWorld();
Location location = projectile.getLocation();
if (effect.equalsIgnoreCase("normal")) {
} else if (effect.equalsIgnoreCase("flame")) {
SkyWarsReloaded.getNMS().sendParticles(world, "FLAME", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("smoke")) {
SkyWarsReloaded.getNMS().sendParticles(world, "SMOKE_LARGE", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("portal")) {
SkyWarsReloaded.getNMS().sendParticles(world, "PORTAL", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("heart")) {
SkyWarsReloaded.getNMS().sendParticles(world, "HEART", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("critical")) {
SkyWarsReloaded.getNMS().sendParticles(world, "CRIT", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("water")) {
SkyWarsReloaded.getNMS().sendParticles(world, "WATER_SPLASH", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("redstone")) {
SkyWarsReloaded.getNMS().sendParticles(world, "REDSTONE", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("sparks")) {
SkyWarsReloaded.getNMS().sendParticles(world, "FIREWORKS_SPARK", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("lava_drip")) {
SkyWarsReloaded.getNMS().sendParticles(world, "DRIP_LAVA", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("lava")) {
SkyWarsReloaded.getNMS().sendParticles(world, "LAVA", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("alphabet")) {
SkyWarsReloaded.getNMS().sendParticles(world, "ENCHANTMENT_TABLE", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("happy")) {
SkyWarsReloaded.getNMS().sendParticles(world, "VILLAGER_HAPPY", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("magic")) {
SkyWarsReloaded.getNMS().sendParticles(world, "SPELL_WITCH", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("music")) {
SkyWarsReloaded.getNMS().sendParticles(world, "NOTE", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("angry")) {
SkyWarsReloaded.getNMS().sendParticles(world, "VILLAGER_ANGRY", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("clouds")) {
SkyWarsReloaded.getNMS().sendParticles(world, "CLOUD", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("potion")) {
SkyWarsReloaded.getNMS().sendParticles(world, "SPELL", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("poison")) {
SkyWarsReloaded.getNMS().sendParticles(world, "SPELL_INSTANT", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("snow")) {
SkyWarsReloaded.getNMS().sendParticles(world, "SNOWBALL", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
} else if (effect.equalsIgnoreCase("slime")) {
SkyWarsReloaded.getNMS().sendParticles(world, "SLIME", (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 2);
}
}