Search in sources :

Example 1 with EntityFXTeleport

use of micdoodle8.mods.galacticraft.planets.asteroids.client.fx.EntityFXTeleport in project Galacticraft by micdoodle8.

the class AsteroidsModuleClient 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 (dX * dX + dY * dY + dZ * dZ < viewDistance * viewDistance) {
            if (particleID.equals("portalBlue")) {
                particle = new EntityFXTeleport(mc.theWorld, position, motion, (TileEntityShortRangeTelepad) extraData[0], (Boolean) extraData[1]);
            } else if (particleID.equals("cryoFreeze")) {
                particle = new EntityCryoFX(mc.theWorld, position, motion);
            }
        }
        if (particle != null) {
            particle.prevPosX = particle.posX;
            particle.prevPosY = particle.posY;
            particle.prevPosZ = particle.posZ;
            mc.effectRenderer.addEffect(particle);
        }
    }
}
Also used : TileEntityShortRangeTelepad(micdoodle8.mods.galacticraft.planets.asteroids.tile.TileEntityShortRangeTelepad) EntityCryoFX(micdoodle8.mods.galacticraft.planets.mars.client.fx.EntityCryoFX) EntityFX(net.minecraft.client.particle.EntityFX) Minecraft(net.minecraft.client.Minecraft) EntityFXTeleport(micdoodle8.mods.galacticraft.planets.asteroids.client.fx.EntityFXTeleport)

Aggregations

EntityFXTeleport (micdoodle8.mods.galacticraft.planets.asteroids.client.fx.EntityFXTeleport)1 TileEntityShortRangeTelepad (micdoodle8.mods.galacticraft.planets.asteroids.tile.TileEntityShortRangeTelepad)1 EntityCryoFX (micdoodle8.mods.galacticraft.planets.mars.client.fx.EntityCryoFX)1 Minecraft (net.minecraft.client.Minecraft)1 EntityFX (net.minecraft.client.particle.EntityFX)1