Search in sources :

Example 1 with EntityAcidVaporFX

use of micdoodle8.mods.galacticraft.planets.venus.client.fx.EntityAcidVaporFX in project Galacticraft by micdoodle8.

the class VenusModuleClient 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) {
        double dX = mc.getRenderViewEntity().posX - position.x;
        double dY = mc.getRenderViewEntity().posY - position.y;
        double dZ = mc.getRenderViewEntity().posZ - position.z;
        EntityFX particle = null;
        double viewDistance = 64.0D;
        if (particleID.equals("acidVapor")) {
            particle = new EntityAcidVaporFX(mc.theWorld, position.x, position.y, position.z, motion.x, motion.y, motion.z, 2.5F);
        }
        if (dX * dX + dY * dY + dZ * dZ < viewDistance * viewDistance) {
            if (particleID.equals("acidExhaust")) {
                particle = new EntityAcidExhaustFX(mc.theWorld, position.x, position.y, position.z, motion.x, motion.y, motion.z, 0.5F);
            }
        }
        if (particle != null) {
            particle.prevPosX = particle.posX;
            particle.prevPosY = particle.posY;
            particle.prevPosZ = particle.posZ;
            mc.effectRenderer.addEffect(particle);
        }
    }
}
Also used : EntityAcidVaporFX(micdoodle8.mods.galacticraft.planets.venus.client.fx.EntityAcidVaporFX) EntityFX(net.minecraft.client.particle.EntityFX) Minecraft(net.minecraft.client.Minecraft) EntityAcidExhaustFX(micdoodle8.mods.galacticraft.planets.venus.client.fx.EntityAcidExhaustFX)

Aggregations

EntityAcidExhaustFX (micdoodle8.mods.galacticraft.planets.venus.client.fx.EntityAcidExhaustFX)1 EntityAcidVaporFX (micdoodle8.mods.galacticraft.planets.venus.client.fx.EntityAcidVaporFX)1 Minecraft (net.minecraft.client.Minecraft)1 EntityFX (net.minecraft.client.particle.EntityFX)1