Search in sources :

Example 1 with EntityBacterialDripFX

use of micdoodle8.mods.galacticraft.planets.mars.client.fx.EntityBacterialDripFX in project Galacticraft by micdoodle8.

the class MarsModuleClient method spawnParticle.

@Override
public void spawnParticle(String particleID, Vector3 position, Vector3 motion, Object... extraData) {
    Minecraft mc = FMLClientHandler.instance().getClient();
    if (mc != null && mc.getRenderViewEntity() != null && mc.effectRenderer != null) {
        final double dPosX = mc.getRenderViewEntity().posX - position.x;
        final double dPosY = mc.getRenderViewEntity().posY - position.y;
        final double dPosZ = mc.getRenderViewEntity().posZ - position.z;
        EntityFX particle = null;
        final double maxDistSqrd = 64.0D;
        if (dPosX * dPosX + dPosY * dPosY + dPosZ * dPosZ < maxDistSqrd * maxDistSqrd) {
            if (particleID.equals("sludgeDrip")) {
            // particle = new EntityDropParticleFX(mc.theWorld, position.x, position.y, position.z, Material.water); TODO
            } else if (particleID.equals("bacterialDrip")) {
                particle = new EntityBacterialDripFX(mc.theWorld, position.x, position.y, position.z);
            }
        }
        if (particle != null) {
            particle.prevPosX = particle.posX;
            particle.prevPosY = particle.posY;
            particle.prevPosZ = particle.posZ;
            mc.effectRenderer.addEffect(particle);
        }
    }
}
Also used : EntityBacterialDripFX(micdoodle8.mods.galacticraft.planets.mars.client.fx.EntityBacterialDripFX) EntityFX(net.minecraft.client.particle.EntityFX) Minecraft(net.minecraft.client.Minecraft)

Aggregations

EntityBacterialDripFX (micdoodle8.mods.galacticraft.planets.mars.client.fx.EntityBacterialDripFX)1 Minecraft (net.minecraft.client.Minecraft)1 EntityFX (net.minecraft.client.particle.EntityFX)1