Java 类net.minecraft.server.EnumParticle 实例源码

项目:ProjectAres    文件:NMSHacks.java   
public static Object particlesPacket(String name, boolean longRange, Vector pos, Vector offset, float data, int count, int... extra) {
    return new PacketPlayOutWorldParticles(EnumParticle.valueOf(EnumParticle.class, name),
                                           longRange,
                                           (float) pos.getX(), (float) pos.getY(), (float) pos.getZ(),
                                           (float) offset.getX(), (float) offset.getY(), (float) offset.getZ(),
                                           data,
                                           count,
                                           extra);
}
项目:CardinalPGM    文件:FlagObjective.java   
private void sendParticles() {
    Location loc = picker != null ? picker.getLocation() : getCurrentFlagLocation();
    Long time = System.currentTimeMillis();
    if ((isOnPost() || isDropped()) && lastParticle < time - 500) {
        lastParticle = time;
        PacketPlayOutWorldParticles portalPacket = new PacketPlayOutWorldParticles(EnumParticle.PORTAL, false, (float)loc.getX(), (float)loc.getY() + 1f, (float)loc.getZ(), 0f, 0f, 0f, 1f, 8);
        PacketUtils.broadcastPacket(portalPacket);
    }
    if (beam) {
        loc.add(0, 56.0, 0);
        PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(EnumParticle.ITEM_CRACK, true, (float)loc.getX(), (float)loc.getY(), (float)loc.getZ(), 0.15f, 24.0f, 0.15f, 0.0f, 40, 35, (int)color.getWoolData());
        PacketUtils.broadcastPacket(packet);
    }
}
项目:CardinalPGM    文件:ProjectileParticlesModule.java   
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);
}
项目:SpigotSource    文件:ParticleTest.java   
@Test
public void verifyMapping() {
    for (Particle bukkit : Particle.values()) {
        Assert.assertNotNull("Missing Bukkit->NMS particle mapping", CraftParticle.toNMS(bukkit));
    }
    for (EnumParticle nms : EnumParticle.values()) {
        Assert.assertNotNull("Missing NMS->Bukkit particle mapping", CraftParticle.toBukkit(nms));
    }
}
项目:SpigotSource    文件:CraftParticle.java   
public static EnumParticle toNMS(Particle bukkit) {
    return EnumParticle.valueOf(bukkit.name());
}
项目:SpigotSource    文件:CraftParticle.java   
public static Particle toBukkit(EnumParticle nms) {
    return Particle.valueOf(nms.name());
}