Java 类net.minecraft.network.play.server.S2APacketParticles 实例源码

项目:DecompiledMinecraft    文件:WorldServer.java   
/**
 * Spawns the desired particle and sends the necessary packets to the relevant connected players.
 */
public void spawnParticle(EnumParticleTypes particleType, boolean longDistance, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed, int... p_180505_18_)
{
    Packet packet = new S2APacketParticles(particleType, longDistance, (float)xCoord, (float)yCoord, (float)zCoord, (float)xOffset, (float)yOffset, (float)zOffset, (float)particleSpeed, numberOfParticles, p_180505_18_);

    for (int i = 0; i < this.playerEntities.size(); ++i)
    {
        EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntities.get(i);
        BlockPos blockpos = entityplayermp.getPosition();
        double d0 = blockpos.distanceSq(xCoord, yCoord, zCoord);

        if (d0 <= 256.0D || longDistance && d0 <= 65536.0D)
        {
            entityplayermp.playerNetServerHandler.sendPacket(packet);
        }
    }
}
项目:DecompiledMinecraft    文件:WorldServer.java   
/**
 * Spawns the desired particle and sends the necessary packets to the relevant connected players.
 */
public void spawnParticle(EnumParticleTypes particleType, boolean longDistance, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed, int... p_180505_18_)
{
    Packet packet = new S2APacketParticles(particleType, longDistance, (float)xCoord, (float)yCoord, (float)zCoord, (float)xOffset, (float)yOffset, (float)zOffset, (float)particleSpeed, numberOfParticles, p_180505_18_);

    for (int i = 0; i < this.playerEntities.size(); ++i)
    {
        EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntities.get(i);
        BlockPos blockpos = entityplayermp.getPosition();
        double d0 = blockpos.distanceSq(xCoord, yCoord, zCoord);

        if (d0 <= 256.0D || longDistance && d0 <= 65536.0D)
        {
            entityplayermp.playerNetServerHandler.sendPacket(packet);
        }
    }
}
项目:BaseClient    文件:WorldServer.java   
/**
 * Spawns the desired particle and sends the necessary packets to the relevant connected players.
 */
public void spawnParticle(EnumParticleTypes particleType, boolean longDistance, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed, int... p_180505_18_)
{
    Packet packet = new S2APacketParticles(particleType, longDistance, (float)xCoord, (float)yCoord, (float)zCoord, (float)xOffset, (float)yOffset, (float)zOffset, (float)particleSpeed, numberOfParticles, p_180505_18_);

    for (int i = 0; i < this.playerEntities.size(); ++i)
    {
        EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntities.get(i);
        BlockPos blockpos = entityplayermp.getPosition();
        double d0 = blockpos.distanceSq(xCoord, yCoord, zCoord);

        if (d0 <= 256.0D || longDistance && d0 <= 65536.0D)
        {
            entityplayermp.playerNetServerHandler.sendPacket(packet);
        }
    }
}
项目:BaseClient    文件:WorldServer.java   
/**
 * Spawns the desired particle and sends the necessary packets to the relevant connected players.
 */
public void spawnParticle(EnumParticleTypes particleType, boolean longDistance, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed, int... p_180505_18_)
{
    Packet packet = new S2APacketParticles(particleType, longDistance, (float)xCoord, (float)yCoord, (float)zCoord, (float)xOffset, (float)yOffset, (float)zOffset, (float)particleSpeed, numberOfParticles, p_180505_18_);

    for (int i = 0; i < this.playerEntities.size(); ++i)
    {
        EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntities.get(i);
        BlockPos blockpos = entityplayermp.getPosition();
        double d0 = blockpos.distanceSq(xCoord, yCoord, zCoord);

        if (d0 <= 256.0D || longDistance && d0 <= 65536.0D)
        {
            entityplayermp.playerNetServerHandler.sendPacket(packet);
        }
    }
}
项目:Jiffy    文件:WorldServer.java   
public void func_147487_a(String p_147487_1_, double p_147487_2_, double p_147487_4_, double p_147487_6_,
        int p_147487_8_, double p_147487_9_, double p_147487_11_, double p_147487_13_, double p_147487_15_) {
    S2APacketParticles s2apacketparticles = new S2APacketParticles(p_147487_1_, (float) p_147487_2_,
            (float) p_147487_4_, (float) p_147487_6_, (float) p_147487_9_, (float) p_147487_11_,
            (float) p_147487_13_, (float) p_147487_15_, p_147487_8_);

    for (int j = 0; j < this.playerEntities.size(); ++j) {
        EntityPlayerMP entityplayermp = (EntityPlayerMP) this.playerEntities.get(j);
        ChunkCoordinates chunkcoordinates = entityplayermp.getPlayerCoordinates();
        double d7 = p_147487_2_ - (double) chunkcoordinates.posX;
        double d8 = p_147487_4_ - (double) chunkcoordinates.posY;
        double d9 = p_147487_6_ - (double) chunkcoordinates.posZ;
        double d10 = d7 * d7 + d8 * d8 + d9 * d9;

        if (d10 <= 256.0D) {
            entityplayermp.playerNetServerHandler.sendPacket(s2apacketparticles);
        }
    }
}
项目:Resilience-Client-Source    文件:WorldServer.java   
public void func_147487_a(String p_147487_1_, double p_147487_2_, double p_147487_4_, double p_147487_6_, int p_147487_8_, double p_147487_9_, double p_147487_11_, double p_147487_13_, double p_147487_15_)
{
    S2APacketParticles var17 = new S2APacketParticles(p_147487_1_, (float)p_147487_2_, (float)p_147487_4_, (float)p_147487_6_, (float)p_147487_9_, (float)p_147487_11_, (float)p_147487_13_, (float)p_147487_15_, p_147487_8_);

    for (int var18 = 0; var18 < this.playerEntities.size(); ++var18)
    {
        EntityPlayerMP var19 = (EntityPlayerMP)this.playerEntities.get(var18);
        ChunkCoordinates var20 = var19.getPlayerCoordinates();
        double var21 = p_147487_2_ - (double)var20.posX;
        double var23 = p_147487_4_ - (double)var20.posY;
        double var25 = p_147487_6_ - (double)var20.posZ;
        double var27 = var21 * var21 + var23 * var23 + var25 * var25;

        if (var27 <= 256.0D)
        {
            var19.playerNetServerHandler.sendPacket(var17);
        }
    }
}
项目:Resilience-Client-Source    文件:NetHandlerPlayClient.java   
/**
 * Spawns a specified number of particles at the specified location with a randomized displacement according to
 * specified bounds
 */
public void handleParticles(S2APacketParticles p_147289_1_)
{
    if (p_147289_1_.func_149222_k() == 0)
    {
        double var2 = (double)(p_147289_1_.func_149227_j() * p_147289_1_.func_149221_g());
        double var4 = (double)(p_147289_1_.func_149227_j() * p_147289_1_.func_149224_h());
        double var6 = (double)(p_147289_1_.func_149227_j() * p_147289_1_.func_149223_i());
        this.clientWorldController.spawnParticle(p_147289_1_.func_149228_c(), p_147289_1_.func_149220_d(), p_147289_1_.func_149226_e(), p_147289_1_.func_149225_f(), var2, var4, var6);
    }
    else
    {
        for (int var15 = 0; var15 < p_147289_1_.func_149222_k(); ++var15)
        {
            double var3 = this.avRandomizer.nextGaussian() * (double)p_147289_1_.func_149221_g();
            double var5 = this.avRandomizer.nextGaussian() * (double)p_147289_1_.func_149224_h();
            double var7 = this.avRandomizer.nextGaussian() * (double)p_147289_1_.func_149223_i();
            double var9 = this.avRandomizer.nextGaussian() * (double)p_147289_1_.func_149227_j();
            double var11 = this.avRandomizer.nextGaussian() * (double)p_147289_1_.func_149227_j();
            double var13 = this.avRandomizer.nextGaussian() * (double)p_147289_1_.func_149227_j();
            this.clientWorldController.spawnParticle(p_147289_1_.func_149228_c(), p_147289_1_.func_149220_d() + var3, p_147289_1_.func_149226_e() + var5, p_147289_1_.func_149225_f() + var7, var9, var11, var13);
        }
    }
}
项目:Cauldron    文件:WorldServer.java   
public void func_147487_a(String p_147487_1_, double p_147487_2_, double p_147487_4_, double p_147487_6_, int p_147487_8_, double p_147487_9_, double p_147487_11_, double p_147487_13_, double p_147487_15_)
{
    S2APacketParticles s2apacketparticles = new S2APacketParticles(p_147487_1_, (float)p_147487_2_, (float)p_147487_4_, (float)p_147487_6_, (float)p_147487_9_, (float)p_147487_11_, (float)p_147487_13_, (float)p_147487_15_, p_147487_8_);

    for (int j = 0; j < this.playerEntities.size(); ++j)
    {
        EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntities.get(j);
        ChunkCoordinates chunkcoordinates = entityplayermp.getPlayerCoordinates();
        double d7 = p_147487_2_ - (double)chunkcoordinates.posX;
        double d8 = p_147487_4_ - (double)chunkcoordinates.posY;
        double d9 = p_147487_6_ - (double)chunkcoordinates.posZ;
        double d10 = d7 * d7 + d8 * d8 + d9 * d9;

        if (d10 <= 256.0D)
        {
            entityplayermp.playerNetServerHandler.sendPacket(s2apacketparticles);
        }
    }
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handleParticles(S2APacketParticles p_147289_1_)
{
    if (p_147289_1_.func_149222_k() == 0)
    {
        double d0 = (double)(p_147289_1_.func_149227_j() * p_147289_1_.func_149221_g());
        double d2 = (double)(p_147289_1_.func_149227_j() * p_147289_1_.func_149224_h());
        double d4 = (double)(p_147289_1_.func_149227_j() * p_147289_1_.func_149223_i());
        this.clientWorldController.spawnParticle(p_147289_1_.func_149228_c(), p_147289_1_.func_149220_d(), p_147289_1_.func_149226_e(), p_147289_1_.func_149225_f(), d0, d2, d4);
    }
    else
    {
        for (int i = 0; i < p_147289_1_.func_149222_k(); ++i)
        {
            double d1 = this.avRandomizer.nextGaussian() * (double)p_147289_1_.func_149221_g();
            double d3 = this.avRandomizer.nextGaussian() * (double)p_147289_1_.func_149224_h();
            double d5 = this.avRandomizer.nextGaussian() * (double)p_147289_1_.func_149223_i();
            double d6 = this.avRandomizer.nextGaussian() * (double)p_147289_1_.func_149227_j();
            double d7 = this.avRandomizer.nextGaussian() * (double)p_147289_1_.func_149227_j();
            double d8 = this.avRandomizer.nextGaussian() * (double)p_147289_1_.func_149227_j();
            this.clientWorldController.spawnParticle(p_147289_1_.func_149228_c(), p_147289_1_.func_149220_d() + d1, p_147289_1_.func_149226_e() + d3, p_147289_1_.func_149225_f() + d5, d6, d7, d8);
        }
    }
}
项目:Cauldron    文件:WorldServer.java   
public void func_147487_a(String p_147487_1_, double p_147487_2_, double p_147487_4_, double p_147487_6_, int p_147487_8_, double p_147487_9_, double p_147487_11_, double p_147487_13_, double p_147487_15_)
{
    S2APacketParticles s2apacketparticles = new S2APacketParticles(p_147487_1_, (float)p_147487_2_, (float)p_147487_4_, (float)p_147487_6_, (float)p_147487_9_, (float)p_147487_11_, (float)p_147487_13_, (float)p_147487_15_, p_147487_8_);

    for (int j = 0; j < this.playerEntities.size(); ++j)
    {
        EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntities.get(j);
        ChunkCoordinates chunkcoordinates = entityplayermp.getPlayerCoordinates();
        double d7 = p_147487_2_ - (double)chunkcoordinates.posX;
        double d8 = p_147487_4_ - (double)chunkcoordinates.posY;
        double d9 = p_147487_6_ - (double)chunkcoordinates.posZ;
        double d10 = d7 * d7 + d8 * d8 + d9 * d9;

        if (d10 <= 256.0D)
        {
            entityplayermp.playerNetServerHandler.sendPacket(s2apacketparticles);
        }
    }
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handleParticles(S2APacketParticles p_147289_1_)
{
    if (p_147289_1_.func_149222_k() == 0)
    {
        double d0 = (double)(p_147289_1_.func_149227_j() * p_147289_1_.func_149221_g());
        double d2 = (double)(p_147289_1_.func_149227_j() * p_147289_1_.func_149224_h());
        double d4 = (double)(p_147289_1_.func_149227_j() * p_147289_1_.func_149223_i());
        this.clientWorldController.spawnParticle(p_147289_1_.func_149228_c(), p_147289_1_.func_149220_d(), p_147289_1_.func_149226_e(), p_147289_1_.func_149225_f(), d0, d2, d4);
    }
    else
    {
        for (int i = 0; i < p_147289_1_.func_149222_k(); ++i)
        {
            double d1 = this.avRandomizer.nextGaussian() * (double)p_147289_1_.func_149221_g();
            double d3 = this.avRandomizer.nextGaussian() * (double)p_147289_1_.func_149224_h();
            double d5 = this.avRandomizer.nextGaussian() * (double)p_147289_1_.func_149223_i();
            double d6 = this.avRandomizer.nextGaussian() * (double)p_147289_1_.func_149227_j();
            double d7 = this.avRandomizer.nextGaussian() * (double)p_147289_1_.func_149227_j();
            double d8 = this.avRandomizer.nextGaussian() * (double)p_147289_1_.func_149227_j();
            this.clientWorldController.spawnParticle(p_147289_1_.func_149228_c(), p_147289_1_.func_149220_d() + d1, p_147289_1_.func_149226_e() + d3, p_147289_1_.func_149225_f() + d5, d6, d7, d8);
        }
    }
}
项目:BlazeLoader    文件:ParticlesRegister.java   
public void spawnParticle(ParticleData particle, World world) {
    if (particle.getType() == ParticleType.NONE) return;

    //TODO: Setup a channel for Blazeloader to send/receive custom particles. For now this will only send particles recognized by vanilla minecraft.
    if (EnumParticleTypes.PARTICLES.containsKey(particle.getType().getId())) {
        Packet packet = new S2APacketParticles(EnumParticleTypes.getParticleFromId(particle.getType().getId()), particle.getIgnoreDistance(), (float)particle.posX, (float)particle.posY, (float)particle.posZ, 0, 0, 0, (float)particle.getVel().lengthVector(), 1, particle.getArgs());
     for (EntityPlayerMP player : (ArrayList<EntityPlayerMP>)(((WorldServer)world).playerEntities)) {
         BlockPos pos = player.getPosition();
         double dist = pos.distanceSq(particle.posX, particle.posY, particle.posZ);
         if (dist <= particle.getMaxRenderDistance() || particle.getIgnoreDistance() && dist <= 65536.0D) {
            //BLPacketChannels.sendPacket(player, packet, Channel.PARTICLES);
             player.playerNetServerHandler.sendPacket(packet);
         }
     }
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Spawns a specified number of particles at the specified location with a
 * randomized displacement according to specified bounds
 */
public void handleParticles(S2APacketParticles packetIn) {
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (packetIn.getParticleCount() == 0) {
        double d0 = (double) (packetIn.getParticleSpeed() * packetIn.getXOffset());
        double d2 = (double) (packetIn.getParticleSpeed() * packetIn.getYOffset());
        double d4 = (double) (packetIn.getParticleSpeed() * packetIn.getZOffset());

        try {
            this.clientWorldController.spawnParticle(packetIn.getParticleType(), packetIn.isLongDistance(),
                    packetIn.getXCoordinate(), packetIn.getYCoordinate(), packetIn.getZCoordinate(), d0, d2, d4,
                    packetIn.getParticleArgs());
        } catch (Throwable var17) {
            logger.warn("Could not spawn particle effect " + packetIn.getParticleType());
        }
    } else {
        for (int i = 0; i < packetIn.getParticleCount(); ++i) {
            double d1 = this.avRandomizer.nextGaussian() * (double) packetIn.getXOffset();
            double d3 = this.avRandomizer.nextGaussian() * (double) packetIn.getYOffset();
            double d5 = this.avRandomizer.nextGaussian() * (double) packetIn.getZOffset();
            double d6 = this.avRandomizer.nextGaussian() * (double) packetIn.getParticleSpeed();
            double d7 = this.avRandomizer.nextGaussian() * (double) packetIn.getParticleSpeed();
            double d8 = this.avRandomizer.nextGaussian() * (double) packetIn.getParticleSpeed();

            try {
                this.clientWorldController.spawnParticle(packetIn.getParticleType(), packetIn.isLongDistance(),
                        packetIn.getXCoordinate() + d1, packetIn.getYCoordinate() + d3,
                        packetIn.getZCoordinate() + d5, d6, d7, d8, packetIn.getParticleArgs());
            } catch (Throwable var16) {
                logger.warn("Could not spawn particle effect " + packetIn.getParticleType());
                return;
            }
        }
    }
}
项目:WorldBorder-Forge    文件:Particles.java   
private static void emitSmoke(WorldServer world, double x, double y, double z)
{
    S2APacketParticles packet = new S2APacketParticles(
        "largesmoke", (float) x, (float) y, (float) z,
        0f, 0.5f, 0f, 0.0f, 10
    );

    dispatch(world, packet);
}
项目:WorldBorder-Forge    文件:Particles.java   
private static void emitEnder(WorldServer world, double x, double y, double z)
{
    S2APacketParticles packet = new S2APacketParticles(
        "portal", (float) x, (float) y, (float) z,
        0.5f, 0.5f, 0.5f, 1.0f, 50
    );

    dispatch(world, packet);
}
项目:DecompiledMinecraft    文件:NetHandlerPlayClient.java   
/**
 * Spawns a specified number of particles at the specified location with a randomized displacement according to
 * specified bounds
 */
public void handleParticles(S2APacketParticles packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (packetIn.getParticleCount() == 0)
    {
        double d0 = (double)(packetIn.getParticleSpeed() * packetIn.getXOffset());
        double d2 = (double)(packetIn.getParticleSpeed() * packetIn.getYOffset());
        double d4 = (double)(packetIn.getParticleSpeed() * packetIn.getZOffset());

        try
        {
            this.clientWorldController.spawnParticle(packetIn.getParticleType(), packetIn.isLongDistance(), packetIn.getXCoordinate(), packetIn.getYCoordinate(), packetIn.getZCoordinate(), d0, d2, d4, packetIn.getParticleArgs());
        }
        catch (Throwable var17)
        {
            logger.warn("Could not spawn particle effect " + packetIn.getParticleType());
        }
    }
    else
    {
        for (int i = 0; i < packetIn.getParticleCount(); ++i)
        {
            double d1 = this.avRandomizer.nextGaussian() * (double)packetIn.getXOffset();
            double d3 = this.avRandomizer.nextGaussian() * (double)packetIn.getYOffset();
            double d5 = this.avRandomizer.nextGaussian() * (double)packetIn.getZOffset();
            double d6 = this.avRandomizer.nextGaussian() * (double)packetIn.getParticleSpeed();
            double d7 = this.avRandomizer.nextGaussian() * (double)packetIn.getParticleSpeed();
            double d8 = this.avRandomizer.nextGaussian() * (double)packetIn.getParticleSpeed();

            try
            {
                this.clientWorldController.spawnParticle(packetIn.getParticleType(), packetIn.isLongDistance(), packetIn.getXCoordinate() + d1, packetIn.getYCoordinate() + d3, packetIn.getZCoordinate() + d5, d6, d7, d8, packetIn.getParticleArgs());
            }
            catch (Throwable var16)
            {
                logger.warn("Could not spawn particle effect " + packetIn.getParticleType());
                return;
            }
        }
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Spawns a specified number of particles at the specified location with a randomized displacement according to
 * specified bounds
 */
public void handleParticles(S2APacketParticles packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (packetIn.getParticleCount() == 0)
    {
        double d0 = (double)(packetIn.getParticleSpeed() * packetIn.getXOffset());
        double d2 = (double)(packetIn.getParticleSpeed() * packetIn.getYOffset());
        double d4 = (double)(packetIn.getParticleSpeed() * packetIn.getZOffset());

        try
        {
            this.clientWorldController.spawnParticle(packetIn.getParticleType(), packetIn.isLongDistance(), packetIn.getXCoordinate(), packetIn.getYCoordinate(), packetIn.getZCoordinate(), d0, d2, d4, packetIn.getParticleArgs());
        }
        catch (Throwable var17)
        {
            logger.warn("Could not spawn particle effect " + packetIn.getParticleType());
        }
    }
    else
    {
        for (int i = 0; i < packetIn.getParticleCount(); ++i)
        {
            double d1 = this.avRandomizer.nextGaussian() * (double)packetIn.getXOffset();
            double d3 = this.avRandomizer.nextGaussian() * (double)packetIn.getYOffset();
            double d5 = this.avRandomizer.nextGaussian() * (double)packetIn.getZOffset();
            double d6 = this.avRandomizer.nextGaussian() * (double)packetIn.getParticleSpeed();
            double d7 = this.avRandomizer.nextGaussian() * (double)packetIn.getParticleSpeed();
            double d8 = this.avRandomizer.nextGaussian() * (double)packetIn.getParticleSpeed();

            try
            {
                this.clientWorldController.spawnParticle(packetIn.getParticleType(), packetIn.isLongDistance(), packetIn.getXCoordinate() + d1, packetIn.getYCoordinate() + d3, packetIn.getZCoordinate() + d5, d6, d7, d8, packetIn.getParticleArgs());
            }
            catch (Throwable var16)
            {
                logger.warn("Could not spawn particle effect " + packetIn.getParticleType());
                return;
            }
        }
    }
}
项目:WorldBorder-Forge    文件:Particles.java   
private static void dispatch(WorldServer world, S2APacketParticles packet)
{
    for (Object o : world.playerEntities)
        ((EntityPlayerMP) o).playerNetServerHandler.sendPacket(packet);
}
项目:DecompiledMinecraft    文件:INetHandlerPlayClient.java   
/**
 * Spawns a specified number of particles at the specified location with a randomized displacement according to
 * specified bounds
 */
void handleParticles(S2APacketParticles packetIn);
项目:DecompiledMinecraft    文件:INetHandlerPlayClient.java   
/**
 * Spawns a specified number of particles at the specified location with a randomized displacement according to
 * specified bounds
 */
void handleParticles(S2APacketParticles packetIn);
项目:BaseClient    文件:INetHandlerPlayClient.java   
/**
 * Spawns a specified number of particles at the specified location with a randomized displacement according to
 * specified bounds
 */
void handleParticles(S2APacketParticles packetIn);
项目:BaseClient    文件:INetHandlerPlayClient.java   
/**
 * Spawns a specified number of particles at the specified location with a randomized displacement according to
 * specified bounds
 */
void handleParticles(S2APacketParticles packetIn);
项目:Resilience-Client-Source    文件:INetHandlerPlayClient.java   
/**
 * Spawns a specified number of particles at the specified location with a randomized displacement according to
 * specified bounds
 */
void handleParticles(S2APacketParticles var1);
项目:Cauldron    文件:INetHandlerPlayClient.java   
void handleParticles(S2APacketParticles p_147289_1_);
项目:Cauldron    文件:INetHandlerPlayClient.java   
void handleParticles(S2APacketParticles p_147289_1_);