Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/80 #98

Merged
merged 4 commits into from
Jun 18, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ public void run() {
}

final Optional<MenuHolder> holder = Menu.getMenuHolder(player);
final String executable = StringUtils.replacePlaceholdersAndArguments(this.exec, this.arguments, player, this.parsePlaceholdersInArguments);

final Player target = holder.isPresent() && holder.get().getPlaceholderPlayer() != null
? holder.get().getPlaceholderPlayer()
: player;

final String executable = StringUtils.replacePlaceholdersAndArguments(this.exec, this.arguments, target, this.parsePlaceholdersInArguments);

switch (actionType) {
case META:
Expand Down Expand Up @@ -405,14 +409,14 @@ public void run() {

switch (actionType) {
case BROADCAST_SOUND:
for (final Player target : Bukkit.getOnlinePlayers()) {
target.playSound(target.getLocation(), sound, volume, pitch);
for (final Player broadcastTarget : Bukkit.getOnlinePlayers()) {
broadcastTarget.playSound(broadcastTarget.getLocation(), sound, volume, pitch);
}
break;

case BROADCAST_WORLD_SOUND:
for (final Player target : player.getWorld().getPlayers()) {
target.playSound(target.getLocation(), sound, volume, pitch);
for (final Player broadcastTarget : player.getWorld().getPlayers()) {
broadcastTarget.playSound(broadcastTarget.getLocation(), sound, volume, pitch);
}
break;

Expand Down