Search in sources :

Example 1 with ConjureParticleOptions

use of at.petrak.hexcasting.common.particles.ConjureParticleOptions in project HexMod by gamma-delta.

the class BlockEntityConjured method landParticle.

public void landParticle(Entity entity, int number) {
    if (getBlockState().getBlock() instanceof BlockConjured) {
        for (int i = 0; i < number * 2; i++) {
            int color = this.colorizer.getColor(entity.tickCount, entity.position().add(new Vec3(RANDOM.nextFloat(), RANDOM.nextFloat(), RANDOM.nextFloat()).scale(RANDOM.nextFloat() * 3)));
            assert level != null;
            level.addParticle(new ConjureParticleOptions(color, false), entity.getX() + (RANDOM.nextFloat() * 0.8D) - 0.2D, getBlockPos().getY() + (RANDOM.nextFloat() * 0.05D) + 0.95D, entity.getZ() + (RANDOM.nextFloat() * 0.8D) - 0.2D, 0.0, 0.0, 0.0);
        }
    }
}
Also used : Vec3(net.minecraft.world.phys.Vec3) ConjureParticleOptions(at.petrak.hexcasting.common.particles.ConjureParticleOptions)

Example 2 with ConjureParticleOptions

use of at.petrak.hexcasting.common.particles.ConjureParticleOptions in project HexMod by gamma-delta.

the class BlockEntityConjured method walkParticle.

public void walkParticle(Entity pEntity) {
    if (getBlockState().getBlock() instanceof BlockConjured) {
        for (int i = 0; i < 3; ++i) {
            int color = this.colorizer.getColor(pEntity.tickCount, pEntity.position().add(new Vec3(RANDOM.nextFloat(), RANDOM.nextFloat(), RANDOM.nextFloat()).scale(RANDOM.nextFloat() * 3)));
            assert level != null;
            level.addParticle(new ConjureParticleOptions(color, false), pEntity.getX() + (RANDOM.nextFloat() * 0.6D) - 0.3D, getBlockPos().getY() + (RANDOM.nextFloat() * 0.05D) + 0.95D, pEntity.getZ() + (RANDOM.nextFloat() * 0.6D) - 0.3D, RANDOM.nextFloat(-0.02f, 0.02f), RANDOM.nextFloat(0.02f), RANDOM.nextFloat(-0.02f, 0.02f));
        }
    }
}
Also used : Vec3(net.minecraft.world.phys.Vec3) ConjureParticleOptions(at.petrak.hexcasting.common.particles.ConjureParticleOptions)

Aggregations

ConjureParticleOptions (at.petrak.hexcasting.common.particles.ConjureParticleOptions)2 Vec3 (net.minecraft.world.phys.Vec3)2