SteamWar/MissileWars
Archiviert
13
0

Merge pull request 'ActionBar on many players' (#48) from action_on_many_players into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #48
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
YoyoNow 2022-08-22 21:59:16 +02:00
Commit 0fffc291cf

Datei anzeigen

@ -23,6 +23,8 @@ import de.steamwar.misslewars.FightState;
import de.steamwar.misslewars.MWTeam;
import de.steamwar.misslewars.MissileWars;
import de.steamwar.misslewars.SpawnPlatformCreator;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@ -48,7 +50,13 @@ public class DeathListener extends BasicListener {
@EventHandler
public void onDeath(PlayerDeathEvent e) {
e.setDeathMessage(null);
Bukkit.broadcastMessage(e.getEntity().getDisplayName() + " §cstarb");
if(Bukkit.getOnlinePlayers().size() > 10) {
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
onlinePlayer.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(e.getEntity().getDisplayName() + " §cstarb"));
}
} else {
Bukkit.broadcastMessage(e.getEntity().getDisplayName() + " §cstarb");
}
}
@EventHandler