Search in sources :

Example 21 with Particle

use of net.minecraft.client.particle.Particle in project Random-Things by lumien231.

the class EntityArtificialEndPortal method spawnParticles.

@SideOnly(Side.CLIENT)
private void spawnParticles() {
    for (int i = 0; i < 5; i++) {
        ParticleEnchantmentTable.EnchantmentTable builder = new ParticleEnchantmentTable.EnchantmentTable();
        double modX = Math.random() * 0.05f - 0.025f;
        double modZ = Math.random() * 0.05f - 0.025f;
        Particle particle = builder.createParticle(0, world, this.posX + modX, this.posY + 2, this.posZ + modZ, modX * 2, 1, modZ * 2);
        particle.setRBGColorF(0.2F + (float) Math.random() * 0.1f, 0, 0.3F + (float) Math.random() * 0.1f);
        Minecraft.getMinecraft().effectRenderer.addEffect(particle);
    }
}
Also used : Particle(net.minecraft.client.particle.Particle) ParticleEnchantmentTable(net.minecraft.client.particle.ParticleEnchantmentTable) ParticleEnchantmentTable(net.minecraft.client.particle.ParticleEnchantmentTable) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 22 with Particle

use of net.minecraft.client.particle.Particle in project Random-Things by lumien231.

the class ItemSpectreKey method onUsingTick.

@Override
@SideOnly(Side.CLIENT)
public void onUsingTick(ItemStack stack, EntityLivingBase livingEntity, int count) {
    if (livingEntity.world.isRemote && count < 60) {
        Particle particle;
        float t = 1F / 255F;
        ParticleSmokeNormal.Factory factory = new ParticleSmokeNormal.Factory();
        for (int i = 0; i < (60 - count) * 2; i++) {
            particle = factory.createParticle(0, livingEntity.world, livingEntity.posX + Math.random() * 1.8 - 0.9, livingEntity.posY + Math.random() * 1.8f, livingEntity.posZ + Math.random() * 1.8 - 0.9, 0, 0, 0);
            particle.setRBGColorF(t * 122F, t * 197F, t * 205F);
            Minecraft.getMinecraft().effectRenderer.addEffect(particle);
        }
    }
}
Also used : Particle(net.minecraft.client.particle.Particle) ParticleSmokeNormal(net.minecraft.client.particle.ParticleSmokeNormal) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 23 with Particle

use of net.minecraft.client.particle.Particle in project Random-Things by lumien231.

the class MessageFlooParticles method onMessage.

@Override
@SideOnly(Side.CLIENT)
public void onMessage(MessageContext context) {
    EntityPlayer player = Minecraft.getMinecraft().player;
    if (player != null) {
        World world = player.world;
        ParticleFlame.Factory factory = new ParticleFlame.Factory();
        for (BlockPos p : brickPositions) {
            for (int i = 0; i < 50; i++) {
                Particle particle = new ParticleFlooFlame(world, p.getX() + Math.random(), p.getY() + 1 + Math.random(), p.getZ() + Math.random(), 0, Math.random() * 0.1, 0);
                Minecraft.getMinecraft().effectRenderer.addEffect(particle);
            }
        }
    }
}
Also used : ParticleFlame(net.minecraft.client.particle.ParticleFlame) Particle(net.minecraft.client.particle.Particle) ParticleFlooFlame(lumien.randomthings.client.particles.ParticleFlooFlame) EntityPlayer(net.minecraft.entity.player.EntityPlayer) BlockPos(net.minecraft.util.math.BlockPos) World(net.minecraft.world.World) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 24 with Particle

use of net.minecraft.client.particle.Particle in project Kingdom-Keys-Re-Coded by Wehavecookies56.

the class ClientProxy method spawnDarkSmokeParticle.

public void spawnDarkSmokeParticle(World world, double posX, double posY, double posZ, double motionX, double motionY, double motionZ, float alpha) {
    Particle particleTest = new EntityParticleFXTest(new ResourceLocation(Reference.MODID, "textures/fx/darksmoke.png"), world, posX, posY, posZ, motionX, motionY, motionZ, alpha);
    Minecraft.getMinecraft().effectRenderer.addEffect(particleTest);
}
Also used : Particle(net.minecraft.client.particle.Particle) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ResourceLocation(net.minecraft.util.ResourceLocation) EntityParticleFXTest(uk.co.wehavecookies56.kk.client.fx.EntityParticleFXTest)

Example 25 with Particle

use of net.minecraft.client.particle.Particle in project Kingdom-Keys-Re-Coded by Wehavecookies56.

the class ClientProxy method spawnTestParticle.

@Override
public void spawnTestParticle(World world, double posX, double posY, double posZ, double motionX, double motionY, double motionZ, float alpha) {
    Particle particleTest = new EntityParticleFXTest(new ResourceLocation(Reference.MODID, "textures/fx/flame.png"), world, posX, posY, posZ, motionX, motionY, motionZ, alpha);
    Minecraft.getMinecraft().effectRenderer.addEffect(particleTest);
}
Also used : Particle(net.minecraft.client.particle.Particle) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ResourceLocation(net.minecraft.util.ResourceLocation) EntityParticleFXTest(uk.co.wehavecookies56.kk.client.fx.EntityParticleFXTest)

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