Search in sources :

Example 1 with TileWindChime

use of pokefenn.totemic.tileentity.music.TileWindChime in project Totemic by TeamTotemic.

the class BlockWindChime method onBlockActivated.

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
    TileWindChime tileWindChime = (TileWindChime) world.getTileEntity(pos);
    if (!world.isRemote && player.isSneaking()) {
        tileWindChime.canPlay = false;
        TotemUtil.playSound(world, pos, ModSounds.windChime, SoundCategory.PLAYERS, 1.0f, 1.0f);
        Totemic.api.music().playSelector(world, pos, player, ModContent.windChime);
        ((WorldServer) world).spawnParticle(EnumParticleTypes.NOTE, pos.getX() + 0.5, pos.getY() - 0.5, pos.getZ() + 0.5, 6, 0.0, 0.0, 0.0, 0.0);
        ((WorldServer) world).spawnParticle(EnumParticleTypes.FIREWORKS_SPARK, pos.getX() + 0.5, pos.getY() - 0.5, pos.getZ() + 0.5, 6, 0.0, 0.0, 0.0, 0.0);
    }
    return true;
}
Also used : TileWindChime(pokefenn.totemic.tileentity.music.TileWindChime) WorldServer(net.minecraft.world.WorldServer)

Aggregations

WorldServer (net.minecraft.world.WorldServer)1 TileWindChime (pokefenn.totemic.tileentity.music.TileWindChime)1