Search in sources :

Example 1 with EntitySpellParticleFX

use of net.minecraft.client.particle.EntitySpellParticleFX in project Armourers-Workshop by RiskyKen.

the class BlockMannequin method randomDisplayTick.

@SideOnly(Side.CLIENT)
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
    if (isTopOfMannequin(world, x, y, z)) {
        if (isValentins) {
            if (random.nextFloat() * 100 > 75) {
                world.spawnParticle("heart", x + 0.2D + random.nextFloat() * 0.6F, y + 1D, z + 0.2D + random.nextFloat() * 0.6F, 0, 0, 0);
            }
        }
        TileEntityMannequin te = getMannequinTileEntity(world, x, y, z);
        if (te != null && te.isRenderExtras()) {
            Contributor contributor = Contributors.INSTANCE.getContributor(te.getGameProfile());
            if (contributor != null & te.isVisible()) {
                for (int i = 0; i < 4; i++) {
                    EntityFX entityfx = new EntitySpellParticleFX(world, x - 1 + random.nextFloat() * 3F, y - 1D, z - 1 + random.nextFloat() * 3F, 0, 0, 0);
                    ((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144);
                    entityfx.setRBGColorF((float) (contributor.r & 0xFF) / 255F, (float) (contributor.g & 0xFF) / 255F, (float) (contributor.b & 0xFF) / 255F);
                    Minecraft.getMinecraft().effectRenderer.addEffect(entityfx);
                }
            }
        }
    }
}
Also used : EntitySpellParticleFX(net.minecraft.client.particle.EntitySpellParticleFX) Contributor(riskyken.armourersWorkshop.common.Contributors.Contributor) EntityFX(net.minecraft.client.particle.EntityFX) TileEntityMannequin(riskyken.armourersWorkshop.common.tileentities.TileEntityMannequin) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 2 with EntitySpellParticleFX

use of net.minecraft.client.particle.EntitySpellParticleFX in project Armourers-Workshop by RiskyKen.

the class BlockDoll method randomDisplayTick.

@SideOnly(Side.CLIENT)
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
    if (isValentins) {
        if (random.nextFloat() * 100 > 80) {
            world.spawnParticle("heart", x + 0.2D + random.nextFloat() * 0.6F, y + 1D, z + 0.2D + random.nextFloat() * 0.6F, 0, 0, 0);
        }
    }
    TileEntity tileEntity = world.getTileEntity(x, y, z);
    if (tileEntity != null && tileEntity instanceof TileEntityMannequin) {
        TileEntityMannequin te = (TileEntityMannequin) tileEntity;
        if (te.isRenderExtras() & te.isVisible()) {
            Contributor contributor = Contributors.INSTANCE.getContributor(te.getGameProfile());
            if (contributor != null) {
                EntityFX entityfx = new EntitySpellParticleFX(world, x + random.nextFloat() * 1F, y, z + random.nextFloat() * 1F, 0, 0, 0);
                ((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144);
                entityfx.setRBGColorF((float) (contributor.r & 0xFF) / 255F, (float) (contributor.g & 0xFF) / 255F, (float) (contributor.b & 0xFF) / 255F);
                Minecraft.getMinecraft().effectRenderer.addEffect(entityfx);
            }
        }
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) EntitySpellParticleFX(net.minecraft.client.particle.EntitySpellParticleFX) Contributor(riskyken.armourersWorkshop.common.Contributors.Contributor) EntityFX(net.minecraft.client.particle.EntityFX) TileEntityMannequin(riskyken.armourersWorkshop.common.tileentities.TileEntityMannequin) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Aggregations

SideOnly (cpw.mods.fml.relauncher.SideOnly)2 EntityFX (net.minecraft.client.particle.EntityFX)2 EntitySpellParticleFX (net.minecraft.client.particle.EntitySpellParticleFX)2 Contributor (riskyken.armourersWorkshop.common.Contributors.Contributor)2 TileEntityMannequin (riskyken.armourersWorkshop.common.tileentities.TileEntityMannequin)2 TileEntity (net.minecraft.tileentity.TileEntity)1