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);
}
}
}
}
}
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);
}
}
}
}
Aggregations