Search in sources :

Example 1 with EntityTrailFX

use of biomesoplenty.client.particle.EntityTrailFX in project BiomesOPlenty by Glitchfiend.

the class ClientProxy method spawnParticle.

@Override
public void spawnParticle(BOPParticleTypes type, World parWorld, double x, double y, double z, Object... info) {
    Minecraft minecraft = Minecraft.getMinecraft();
    Particle entityFx = null;
    switch(type) {
        case PIXIETRAIL:
            entityFx = new EntityPixieTrailFX(parWorld, x, y, z, MathHelper.nextDouble(parWorld.rand, -0.03, 0.03), -0.02D, MathHelper.nextDouble(parWorld.rand, -0.03, 0.03));
            break;
        case MUD:
            int itemId = Item.getIdFromItem(BOPItems.mudball);
            minecraft.world.spawnParticle(EnumParticleTypes.ITEM_CRACK, x, y, z, MathHelper.nextDouble(parWorld.rand, -0.08D, 0.08D), MathHelper.nextDouble(parWorld.rand, -0.08D, 0.08D), MathHelper.nextDouble(parWorld.rand, -0.08D, 0.08D), itemId);
            return;
        case PLAYER_TRAIL:
            if (info.length < 1)
                throw new RuntimeException("Missing argument for trail name!");
            entityFx = new EntityTrailFX(parWorld, x, y, z, (String) info[0]);
            break;
        default:
            break;
    }
    if (entityFx != null) {
        minecraft.effectRenderer.addEffect(entityFx);
    }
}
Also used : Particle(net.minecraft.client.particle.Particle) EntityPixieTrailFX(biomesoplenty.client.particle.EntityPixieTrailFX) EntityTrailFX(biomesoplenty.client.particle.EntityTrailFX) Minecraft(net.minecraft.client.Minecraft)

Aggregations

EntityPixieTrailFX (biomesoplenty.client.particle.EntityPixieTrailFX)1 EntityTrailFX (biomesoplenty.client.particle.EntityTrailFX)1 Minecraft (net.minecraft.client.Minecraft)1 Particle (net.minecraft.client.particle.Particle)1