本文整理汇总了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);
}
}