Search in sources :

Example 11 with ParticleEffect

use of net.minecraft.particle.ParticleEffect in project friends-and-foes by Faboslav.

the class GlareEntity method showEmoteParticle.

protected void showEmoteParticle(boolean positive) {
    ParticleEffect particleEffect;
    if (positive) {
        particleEffect = ParticleTypes.HEART;
    } else {
        particleEffect = ParticleTypes.SMOKE;
    }
    for (int i = 0; i < 7; ++i) {
        double d = this.random.nextGaussian() * 0.02D;
        double e = this.random.nextGaussian() * 0.02D;
        double f = this.random.nextGaussian() * 0.02D;
        this.world.addParticle(particleEffect, this.getParticleX(1.0D), this.getRandomBodyY() + 0.5D, this.getParticleZ(1.0D), d, e, f);
    }
}
Also used : ItemStackParticleEffect(net.minecraft.particle.ItemStackParticleEffect) ParticleEffect(net.minecraft.particle.ParticleEffect)

Example 12 with ParticleEffect

use of net.minecraft.particle.ParticleEffect in project Immersive-Weathering by AstralOrdana.

the class IcicleBlock method createParticle.

private static void createParticle(World world, BlockPos pos, BlockState state, Fluid fluid) {
    Vec3d vec3d = state.getModelOffset(world, pos);
    double e = (double) pos.getX() + 0.5D + vec3d.x;
    double f = (double) ((float) (pos.getY() + 1) - 0.6875F) - 0.0625D;
    double g = (double) pos.getZ() + 0.5D + vec3d.z;
    Fluid fluid2 = getDripFluid(world, fluid);
    ParticleEffect particleEffect = fluid2.isIn(FluidTags.LAVA) ? ParticleTypes.DRIPPING_DRIPSTONE_LAVA : ParticleTypes.DRIPPING_DRIPSTONE_WATER;
    world.addParticle(particleEffect, e, f, g, 0.0D, 0.0D, 0.0D);
}
Also used : ParticleEffect(net.minecraft.particle.ParticleEffect) Fluid(net.minecraft.fluid.Fluid) Vec3d(net.minecraft.util.math.Vec3d)

Aggregations

ParticleEffect (net.minecraft.particle.ParticleEffect)12 ArrayList (java.util.ArrayList)3 Random (java.util.Random)3 Entity (net.minecraft.entity.Entity)3 Box (net.minecraft.util.math.Box)3 Vec3d (net.minecraft.util.math.Vec3d)3 Particle (net.minecraft.client.particle.Particle)2 ItemStack (net.minecraft.item.ItemStack)2 NbtString (net.minecraft.nbt.NbtString)2 ItemStackParticleEffect (net.minecraft.particle.ItemStackParticleEffect)2 ParticleType (net.minecraft.particle.ParticleType)2 McdwBow (chronosacaria.mcdw.bases.McdwBow)1 ParticlesMode (net.minecraft.client.options.ParticlesMode)1 LivingEntity (net.minecraft.entity.LivingEntity)1 ArmorStandEntity (net.minecraft.entity.decoration.ArmorStandEntity)1 ItemFrameEntity (net.minecraft.entity.decoration.ItemFrameEntity)1 Fluid (net.minecraft.fluid.Fluid)1 ParticleS2CPacket (net.minecraft.network.packet.s2c.play.ParticleS2CPacket)1 DustParticleEffect (net.minecraft.particle.DustParticleEffect)1 BlockPos (net.minecraft.util.math.BlockPos)1