Package org.bukkit

Examples of org.bukkit.Sound


      org.bukkit.Effect effect = ParseUtil.parseEnum(org.bukkit.Effect.class, name, null);
      if (effect != null) {
        play(location, effect, 0);
        continue;
      }
      Sound sound = ParseUtil.parseEnum(Sound.class, name, null);
      if (sound != null) {
        location.getWorld().playSound(location, sound, volume, pitch);
        continue;
      }
    }
View Full Code Here


        // get pitch and volume from the midi message
        float pitch = (float) ToneUtil.midiToPitch(message);
        float volume = VOLUME_RANGE * (message.getData2() / 127.0f);

        Sound instrument = Sound.NOTE_PIANO;
        if (patch != null) instrument = MidiUtil.patchToInstrument(patch);

        if (location != null) {
            location.getWorld().playSound(location, instrument, volume, pitch);
        }
View Full Code Here

                        show = nshow;
                        return;
                    } else if (line.startsWith("sound ")) {

                        String[] bits = RegexUtil.SPACE_PATTERN.split(line.replace("sound ", ""));
                        Sound sound = Sound.valueOf(bits[0]);
                        Location sloc = location.clone();
                        float volume = 1.0f,pitch = 1.0f;
                        if(bits.length > 1) {
                            double x,y,z;
                            String[] args = RegexUtil.COMMA_PATTERN.split(bits[1]);
View Full Code Here

        }

        @Override
        public void verify(ChangedSign sign) throws ICVerificationException {

            Sound sound = null;
            try {
                sound = Sound.valueOf(sign.getLine(3).trim());
            } catch(Exception e) {
            }
            if(sound == null && sign.getLine(3).trim().length() == 15) {
View Full Code Here

        setHealth(health - amount);
        playEffect(EntityEffect.HURT);

        // play sounds, handle death
        if (health <= 0.0) {
            Sound deathSound = getDeathSound();
            if (deathSound != null) {
                world.playSound(location, deathSound, 1.0f, 1.0f);
            }
            // todo: drop items
        } else {
            Sound hurtSound = getHurtSound();
            if (hurtSound != null) {
                world.playSound(location, hurtSound, 1.0f, 1.0f);
            }
        }
    }
View Full Code Here

    float pitch = (float) ToneUtil.midiToPitch(message);
    float volume = VOLUME_RANGE * (message.getData2() / 127.0f);

    // get the correct instrument
    Integer patch = channelPatches.get(message.getChannel());
    Sound instrument = Sound.NOTE_PIANO;
    if (patch != null) instrument = MidiUtil.patchToInstrument(patch);

    for (Player player : listeners)
      player.playSound(player.getLocation(), instrument, volume, pitch);
  }
View Full Code Here

TOP

Related Classes of org.bukkit.Sound

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.