Search in sources :

Example 1 with ParticleGasSmoke

use of ladysnake.gaspunk.client.particle.ParticleGasSmoke in project Gaspunk by Ladysnake.

the class ClientProxy method makeSmoke.

@Override
public void makeSmoke(World world, double x, double y, double z, int color, int amount, int radX, int radY, IGasParticleType texture) {
    if (!world.isRemote)
        return;
    float b = (color & 0xFF) / 255F;
    float g = (color >> 8 & 0xFF) / 255F;
    float r = (color >> 16 & 0xFF) / 255F;
    float a = (color >> 24 & 0xFF) / 255F;
    // no need to spawn invisible particles
    if (a == 0)
        return;
    for (int i = 0; i < amount; i++) {
        particleCount += world.rand.nextInt(3);
        if (particleCount % (Minecraft.getMinecraft().gameSettings.particleSetting == 0 ? 1 : 2 * Minecraft.getMinecraft().gameSettings.particleSetting) == 0) {
            double posX = x + world.rand.nextGaussian() * radX % radX;
            double posY = y + world.rand.nextGaussian() * radY % radY;
            double posZ = z + world.rand.nextGaussian() * radX % radX;
            ParticleGasSmoke particle = new ParticleGasSmoke(world, posX, posY, posZ, r, g, b, a, (float) (55 + 20 * world.rand.nextGaussian()));
            particle.setTexture(texture.getParticleTexture());
            LadyLib.getParticleManager().addParticle(particle);
        }
    }
}
Also used : ParticleGasSmoke(ladysnake.gaspunk.client.particle.ParticleGasSmoke)

Aggregations

ParticleGasSmoke (ladysnake.gaspunk.client.particle.ParticleGasSmoke)1