mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-12-21 08:37:50 +01:00
Fixed the click sound being also played to players nearby
This commit is contained in:
parent
c68c8d26cb
commit
d4264a1c26
@ -44,14 +44,14 @@ public class CycleClick implements PanelItem.ClickHandler {
|
|||||||
} else {
|
} else {
|
||||||
island.setFlag(flag, rm.getRankUpValue(currentRank));
|
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)) {
|
} else if (click.equals(ClickType.RIGHT)) {
|
||||||
if (currentRank == RanksManager.VISITOR_RANK) {
|
if (currentRank == RanksManager.VISITOR_RANK) {
|
||||||
island.setFlag(flag, RanksManager.OWNER_RANK);
|
island.setFlag(flag, RanksManager.OWNER_RANK);
|
||||||
} else {
|
} else {
|
||||||
island.setFlag(flag, rm.getRankDownValue(currentRank));
|
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
|
// Apply change to panel
|
||||||
panel.getInventory().setItem(slot, flag.toPanelItem(plugin, user).getItem());
|
panel.getInventory().setItem(slot, flag.toPanelItem(plugin, user).getItem());
|
||||||
|
@ -42,7 +42,7 @@ public class IslandToggleClickListener implements ClickHandler {
|
|||||||
Flag flag = plugin.getFlagsManager().getFlagByID(id);
|
Flag flag = plugin.getFlagsManager().getFlagByID(id);
|
||||||
// Toggle flag
|
// Toggle flag
|
||||||
island.toggleFlag(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
|
// Apply change to panel
|
||||||
panel.getInventory().setItem(slot, flag.toPanelItem(plugin, user).getItem());
|
panel.getInventory().setItem(slot, flag.toPanelItem(plugin, user).getItem());
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ public class WorldToggleClickListener implements ClickHandler {
|
|||||||
Flag flag = plugin.getFlagsManager().getFlagByID(id);
|
Flag flag = plugin.getFlagsManager().getFlagByID(id);
|
||||||
// Toggle flag
|
// Toggle flag
|
||||||
flag.setSetting(user.getWorld(), !flag.isSetForWorld(user.getWorld()));
|
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
|
// Apply change to panel
|
||||||
panel.getInventory().setItem(slot, flag.toPanelItem(plugin, user).getItem());
|
panel.getInventory().setItem(slot, flag.toPanelItem(plugin, user).getItem());
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user