Fix health drops and add sound
This commit is contained in:
parent
e9642d4a6f
commit
6f5d332444
@ -12,6 +12,7 @@ import java.util.stream.Collectors;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
@ -59,6 +60,7 @@ public final class Events implements Listener {
|
|||||||
}
|
}
|
||||||
Collections.sort(uuids);
|
Collections.sort(uuids);
|
||||||
|
|
||||||
|
player.playSound(location, Sound.CLICK, 1, 1);
|
||||||
if (uuids.size() == 0) {
|
if (uuids.size() == 0) {
|
||||||
player.sendMessage(ChatColor.YELLOW + "No targets online!");
|
player.sendMessage(ChatColor.YELLOW + "No targets online!");
|
||||||
} else {
|
} else {
|
||||||
@ -72,11 +74,10 @@ public final class Events implements Listener {
|
|||||||
} else {
|
} else {
|
||||||
QuidProQuo.instance.targets.put(playerUuid, uuids.get(0));
|
QuidProQuo.instance.targets.put(playerUuid, uuids.get(0));
|
||||||
}
|
}
|
||||||
|
// friendly message
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "Switched target to " + Bukkit.getPlayer(QuidProQuo.instance.targets.get(playerUuid)).getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
// friendly message
|
|
||||||
player.sendMessage(ChatColor.YELLOW + "Switched target to " + Bukkit.getPlayer(QuidProQuo.instance.targets.get(playerUuid)).getName());
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// java control flow go brrrr
|
// java control flow go brrrr
|
||||||
@ -162,7 +163,9 @@ public final class Events implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// administer health penalty
|
// administer health penalty
|
||||||
player.setHealth(Math.max(0, player.getHealth() - ritual.health));
|
if (player.getGameMode() != GameMode.CREATIVE && player.getGameMode() != GameMode.SPECTATOR) {
|
||||||
|
player.setHealth(Math.max(0, player.getHealth() - ritual.health));
|
||||||
|
}
|
||||||
|
|
||||||
// shiny message
|
// shiny message
|
||||||
player.sendMessage(ChatColor.GREEN + "You enacted a " + ritual.name + " ritual.");
|
player.sendMessage(ChatColor.GREEN + "You enacted a " + ritual.name + " ritual.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user