Search in sources :

Example 26 with Particle

use of net.minecraft.client.particle.Particle in project DynamicSurroundings by OreCruncher.

the class ParticleSteamJet method spawnJetParticle.

@Override
protected void spawnJetParticle() {
    final Particle particle = new ParticleSteamCloud(this.world, this.posX, this.posY, this.posZ, 0.1D);
    addParticle(particle);
}
Also used : Particle(net.minecraft.client.particle.Particle) ParticleSteamCloud(org.blockartistry.DynSurround.client.fx.particle.ParticleSteamCloud)

Example 27 with Particle

use of net.minecraft.client.particle.Particle in project Railcraft by Railcraft.

the class ClientEffects method tuningEffect.

@Override
public void tuningEffect(TileEntity start, TileEntity dest) {
    if (thinParticles(false))
        return;
    if (rand.nextInt(2) == 0) {
        BlockPos pos = start.getPos();
        double px = pos.getX() + getRandomParticleOffset();
        double py = pos.getY() + getRandomParticleOffset();
        double pz = pos.getZ() + getRandomParticleOffset();
        TESRSignals.ColorProfile colorProfile = TESRSignals.ColorProfile.COORD_RAINBOW;
        if (isGoggleAuraActive(GoggleAura.SIGNALLING))
            colorProfile = TESRSignals.ColorProfile.CONTROLLER_ASPECT;
        int color = colorProfile.getColor(start, start.getPos(), dest.getPos());
        Particle particle = new ParticleTuningAura(start.getWorld(), new Vec3d(px, py, pz), EffectManager.getEffectSource(start), EffectManager.getEffectSource(dest), color);
        spawnParticle(particle);
    }
}
Also used : Particle(net.minecraft.client.particle.Particle) BlockPos(net.minecraft.util.math.BlockPos) TESRSignals(mods.railcraft.client.render.tesr.TESRSignals) Vec3d(net.minecraft.util.math.Vec3d)

Example 28 with Particle

use of net.minecraft.client.particle.Particle in project LogisticsPipes by RS485.

the class LogisticsBlockGenericPipe method addHitEffects.

@SideOnly(Side.CLIENT)
@Override
public boolean addHitEffects(IBlockState state, World world, RayTraceResult target, ParticleManager effectRenderer) {
    if (super.addHitEffects(state, world, target, effectRenderer))
        return true;
    BlockPos pos = target.getBlockPos();
    CoreUnroutedPipe pipe = LogisticsBlockGenericPipe.getPipe(world, pos);
    if (pipe == null) {
        return false;
    }
    TextureAtlasSprite icon = pipe.getIconProvider().getIcon(pipe.getIconIndexForItem());
    EnumFacing sideHit = target.sideHit;
    Block block = LPBlocks.pipe;
    float b = 0.1F;
    double px = target.hitVec.x + rand.nextDouble() * (state.getBoundingBox(world, pos).maxX - state.getBoundingBox(world, pos).minX - (b * 2.0F)) + b + state.getBoundingBox(world, pos).minX;
    double py = target.hitVec.y + rand.nextDouble() * (state.getBoundingBox(world, pos).maxY - state.getBoundingBox(world, pos).minY - (b * 2.0F)) + b + state.getBoundingBox(world, pos).minY;
    double pz = target.hitVec.z + rand.nextDouble() * (state.getBoundingBox(world, pos).maxZ - state.getBoundingBox(world, pos).minZ - (b * 2.0F)) + b + state.getBoundingBox(world, pos).minZ;
    if (sideHit == EnumFacing.DOWN) {
        py = target.hitVec.y + state.getBoundingBox(world, pos).minY - b;
    }
    if (sideHit == EnumFacing.UP) {
        py = target.hitVec.y + state.getBoundingBox(world, pos).maxY + b;
    }
    if (sideHit == EnumFacing.NORTH) {
        pz = target.hitVec.z + state.getBoundingBox(world, pos).minZ - b;
    }
    if (sideHit == EnumFacing.SOUTH) {
        pz = target.hitVec.z + state.getBoundingBox(world, pos).maxZ + b;
    }
    if (sideHit == EnumFacing.EAST) {
        px = target.hitVec.x + state.getBoundingBox(world, pos).minX - b;
    }
    if (sideHit == EnumFacing.WEST) {
        px = target.hitVec.x + state.getBoundingBox(world, pos).maxX + b;
    }
    Particle fx = effectRenderer.spawnEffectParticle(EnumParticleTypes.BLOCK_CRACK.getParticleID(), px, py, pz, 0.0D, 0.0D, 0.0D, Block.getStateId(world.getBlockState(target.getBlockPos())));
    fx.setParticleTexture(icon);
    effectRenderer.addEffect(fx.multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
    return true;
}
Also used : Particle(net.minecraft.client.particle.Particle) TextureAtlasSprite(net.minecraft.client.renderer.texture.TextureAtlasSprite) EnumFacing(net.minecraft.util.EnumFacing) Block(net.minecraft.block.Block) LPMicroblockBlock(logisticspipes.pipes.basic.ltgpmodcompat.LPMicroblockBlock) BlockPos(net.minecraft.util.math.BlockPos) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 29 with Particle

use of net.minecraft.client.particle.Particle in project LogisticsPipes by RS485.

the class PipeFXRenderHandler method spawnGenericParticle.

public static void spawnGenericParticle(Particles particle, double x, double y, double z, int amount) {
    if (MainProxy.getClientMainWorld() == null) {
        return;
    }
    try {
        Minecraft mc = Minecraft.getMinecraft();
        int var14 = mc.gameSettings.particleSetting;
        double var15 = mc.getRenderViewEntity().posX - x;
        double var17 = mc.getRenderViewEntity().posY - y;
        double var19 = mc.getRenderViewEntity().posZ - z;
        Particle effect;
        double var22 = 16.0D;
        if (var15 * var15 + var17 * var17 + var19 * var19 > var22 * var22) {
            return;
        } else if (var14 > 1) {
            return;
        }
        ParticleProvider provider = PipeFXRenderHandler.particlemap[particle.ordinal()];
        if (provider == null) {
            return;
        }
        for (int i = 0; i < Math.sqrt(amount); i++) {
            effect = provider.createGenericParticle(mc.world, x, y, z, amount);
            if (effect != null) {
                mc.effectRenderer.addEffect(effect);
            }
        }
    } catch (NullPointerException ignored) {
    }
}
Also used : Particle(net.minecraft.client.particle.Particle) Minecraft(net.minecraft.client.Minecraft)

Example 30 with Particle

use of net.minecraft.client.particle.Particle in project ImmersiveEngineering by BluSunrize.

the class ClientProxy method spawnSparkFX.

@Override
public void spawnSparkFX(World world, double x, double y, double z, double mx, double my, double mz) {
    Particle particle = new ParticleSparks(world, x, y, z, mx, my, mz);
    Minecraft.getMinecraft().effectRenderer.addEffect(particle);
}
Also used : Particle(net.minecraft.client.particle.Particle) ParticleSparks(blusunrize.immersiveengineering.client.fx.ParticleSparks)

Aggregations

Particle (net.minecraft.client.particle.Particle)52 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)21 ParticleManager (net.minecraft.client.particle.ParticleManager)9 BlockPos (net.minecraft.util.math.BlockPos)8 Vec3d (net.minecraft.util.math.Vec3d)8 IEffectSource (mods.railcraft.common.util.effects.EffectManager.IEffectSource)4 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)4 EntityPlayer (net.minecraft.entity.player.EntityPlayer)4 EnumFacing (net.minecraft.util.EnumFacing)4 Random (java.util.Random)3 Minecraft (net.minecraft.client.Minecraft)3 IBakedModel (net.minecraft.client.renderer.block.model.IBakedModel)3 World (net.minecraft.world.World)3 IStateParticleBakedModel (pl.asie.charset.lib.render.model.IStateParticleBakedModel)3 TESRSignals (mods.railcraft.client.render.tesr.TESRSignals)2 IBlockState (net.minecraft.block.state.IBlockState)2 ParticleFlame (net.minecraft.client.particle.ParticleFlame)2 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)2