Esempio n. 1
0
 public void play(Player player, Point position, float volume, float pitch) {
   // TODO Fix this, these should NEVER BE NULL
   if (player == null
       || player.getSession() == null | player.getSession().getNetworkSynchronizer() == null) {
     return;
   }
   player
       .getSession()
       .getNetworkSynchronizer()
       .callProtocolEvent(new PlaySoundEffectEvent(position, this, volume, pitch));
 }
Esempio n. 2
0
  /** Update the player UI bar. */
  private void updateUi() {

    if (!(getOwner() instanceof Player)) {
      return;
    }
    Player p = (Player) getOwner();
    p.getSession()
        .send(false, new PlayerExperienceMessage(getProgress(), getLevel(), getExperience()));
  }
Esempio n. 3
0
 @Override
 public void play(Player player, Point position, int note) {
   Block block = position.getWorld().getBlock(position);
   player
       .getSession()
       .getNetworkSynchronizer()
       .callProtocolEvent(
           new BlockActionEvent(block, VanillaMaterials.NOTEBLOCK, (byte) 0, (byte) note));
 }
Esempio n. 4
0
 public void play(Player player, Point position, int data) {
   player
       .getSession()
       .getNetworkSynchronizer()
       .callProtocolEvent(new PlayParticleEffectEvent(position, this, data));
 }