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)); }
/** 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())); }
@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)); }
public void play(Player player, Point position, int data) { player .getSession() .getNetworkSynchronizer() .callProtocolEvent(new PlayParticleEffectEvent(position, this, data)); }