Fixed the click sound being also played to players nearby

This commit is contained in:
Florian CUNY 2018-06-16 15:15:15 +02:00
parent c68c8d26cb
commit d4264a1c26
3 changed files with 4 additions and 4 deletions

View File

@ -44,14 +44,14 @@ public class CycleClick implements PanelItem.ClickHandler {
} else {
island.setFlag(flag, rm.getRankUpValue(currentRank));
}
user.getWorld().playSound(user.getLocation(), Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1F, 1F);
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1F, 1F);
} else if (click.equals(ClickType.RIGHT)) {
if (currentRank == RanksManager.VISITOR_RANK) {
island.setFlag(flag, RanksManager.OWNER_RANK);
} else {
island.setFlag(flag, rm.getRankDownValue(currentRank));
}
user.getWorld().playSound(user.getLocation(), Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1F, 1F);
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1F, 1F);
}
// Apply change to panel
panel.getInventory().setItem(slot, flag.toPanelItem(plugin, user).getItem());

View File

@ -42,7 +42,7 @@ public class IslandToggleClickListener implements ClickHandler {
Flag flag = plugin.getFlagsManager().getFlagByID(id);
// Toggle flag
island.toggleFlag(flag);
user.getWorld().playSound(user.getLocation(), Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1F, 1F);
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1F, 1F);
// Apply change to panel
panel.getInventory().setItem(slot, flag.toPanelItem(plugin, user).getItem());
}

View File

@ -51,7 +51,7 @@ public class WorldToggleClickListener implements ClickHandler {
Flag flag = plugin.getFlagsManager().getFlagByID(id);
// Toggle flag
flag.setSetting(user.getWorld(), !flag.isSetForWorld(user.getWorld()));
user.getWorld().playSound(user.getLocation(), Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1F, 1F);
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1F, 1F);
// Apply change to panel
panel.getInventory().setItem(slot, flag.toPanelItem(plugin, user).getItem());
return true;