Search in sources :

Example 6 with EntityFX

use of net.minecraft.client.particle.EntityFX 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)

Example 7 with EntityFX

use of net.minecraft.client.particle.EntityFX 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)

Example 8 with EntityFX

use of net.minecraft.client.particle.EntityFX 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)

Example 9 with EntityFX

use of net.minecraft.client.particle.EntityFX in project BuildCraft by BuildCraft.

the class BlockGenericPipe method addHitEffects.

/**
 * Spawn a digging particle effect in the world, this is a wrapper around EffectRenderer.addBlockHitEffects to
 * allow the block more control over the particles. Useful when you have entirely different texture sheets for
 * different sides/locations in the world.
 *
 * @param worldObj The current world
 * @param target The target the player is looking at {x/y/z/side/sub}
 * @param effectRenderer A reference to the current effect renderer.
 * @return True to prevent vanilla digging particles form spawning.
 */
@SideOnly(Side.CLIENT)
@Override
public boolean addHitEffects(World worldObj, MovingObjectPosition target, EffectRenderer effectRenderer) {
    Pipe<?> pipe = getPipe(worldObj, target.getBlockPos());
    if (pipe == null) {
        return false;
    }
    TextureAtlasSprite icon = pipe.getIconProvider().getIcon(pipe.getIconIndexForItem());
    EnumFacing sideHit = target.sideHit;
    Block block = BuildCraftTransport.genericPipeBlock;
    float b = 0.1F;
    double px = target.hitVec.xCoord + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - (b * 2.0F)) + b + block.getBlockBoundsMinX();
    double py = target.hitVec.yCoord + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - (b * 2.0F)) + b + block.getBlockBoundsMinY();
    double pz = target.hitVec.zCoord + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - (b * 2.0F)) + b + block.getBlockBoundsMinZ();
    if (sideHit == EnumFacing.DOWN) {
        py = target.hitVec.yCoord + block.getBlockBoundsMinY() - b;
    }
    if (sideHit == EnumFacing.UP) {
        py = target.hitVec.yCoord + block.getBlockBoundsMaxY() + b;
    }
    if (sideHit == EnumFacing.NORTH) {
        pz = target.hitVec.zCoord + block.getBlockBoundsMinZ() - b;
    }
    if (sideHit == EnumFacing.SOUTH) {
        pz = target.hitVec.zCoord + block.getBlockBoundsMaxZ() + b;
    }
    if (sideHit == EnumFacing.EAST) {
        px = target.hitVec.xCoord + block.getBlockBoundsMinX() - b;
    }
    if (sideHit == EnumFacing.WEST) {
        px = target.hitVec.xCoord + block.getBlockBoundsMaxX() + b;
    }
    EntityFX fx = effectRenderer.spawnEffectParticle(EnumParticleTypes.BLOCK_CRACK.getParticleID(), px, py, pz, 0.0D, 0.0D, 0.0D, Block.getStateId(worldObj.getBlockState(target.getBlockPos())));
    fx.setParticleIcon(icon);
    effectRenderer.addEffect(fx.multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
    return true;
}
Also used : TextureAtlasSprite(net.minecraft.client.renderer.texture.TextureAtlasSprite) EnumFacing(net.minecraft.util.EnumFacing) Block(net.minecraft.block.Block) EntityFX(net.minecraft.client.particle.EntityFX) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 10 with EntityFX

use of net.minecraft.client.particle.EntityFX in project Armourers-Workshop by RiskyKen.

the class BlockMannequin method randomDisplayTick.

@SideOnly(Side.CLIENT)
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
    if (isTopOfMannequin(world, x, y, z)) {
        if (isValentins) {
            if (random.nextFloat() * 100 > 75) {
                world.spawnParticle("heart", x + 0.2D + random.nextFloat() * 0.6F, y + 1D, z + 0.2D + random.nextFloat() * 0.6F, 0, 0, 0);
            }
        }
        TileEntityMannequin te = getMannequinTileEntity(world, x, y, z);
        if (te != null && te.isRenderExtras()) {
            Contributor contributor = Contributors.INSTANCE.getContributor(te.getGameProfile());
            if (contributor != null & te.isVisible()) {
                for (int i = 0; i < 4; i++) {
                    EntityFX entityfx = new EntitySpellParticleFX(world, x - 1 + random.nextFloat() * 3F, y - 1D, z - 1 + random.nextFloat() * 3F, 0, 0, 0);
                    ((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144);
                    entityfx.setRBGColorF((float) (contributor.r & 0xFF) / 255F, (float) (contributor.g & 0xFF) / 255F, (float) (contributor.b & 0xFF) / 255F);
                    Minecraft.getMinecraft().effectRenderer.addEffect(entityfx);
                }
            }
        }
    }
}
Also used : EntitySpellParticleFX(net.minecraft.client.particle.EntitySpellParticleFX) Contributor(riskyken.armourersWorkshop.common.Contributors.Contributor) EntityFX(net.minecraft.client.particle.EntityFX) TileEntityMannequin(riskyken.armourersWorkshop.common.tileentities.TileEntityMannequin) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Aggregations

EntityFX (net.minecraft.client.particle.EntityFX)21 Minecraft (net.minecraft.client.Minecraft)5 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)4 EntityExplodeFX (net.minecraft.client.particle.EntityExplodeFX)3 Tessellator (net.minecraft.client.renderer.Tessellator)3 SideOnly (cpw.mods.fml.relauncher.SideOnly)2 Vector3 (micdoodle8.mods.galacticraft.api.vector.Vector3)2 Block (net.minecraft.block.Block)2 WorldClient (net.minecraft.client.multiplayer.WorldClient)2 Entity (net.minecraft.entity.Entity)2 TileEntity (net.minecraft.tileentity.TileEntity)2 Pos (com.builtbroken.mc.imp.transform.vector.Pos)1 FXEnderPortalPartical (com.builtbroken.mc.lib.render.fx.FXEnderPortalPartical)1 FXSmoke (com.builtbroken.mc.lib.render.fx.FXSmoke)1 BlockHint (com.github.technus.tectech.entity.fx.BlockHint)1 GameProfile (com.mojang.authlib.GameProfile)1 Property (com.mojang.authlib.properties.Property)1 FXAntimatterPartical (icbm.classic.client.fx.FXAntimatterPartical)1 IOException (java.io.IOException)1 Random (java.util.Random)1