New Fight UI #288
@ -33,12 +33,12 @@ public class WinCommand implements CommandExecutor {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(args[0].equalsIgnoreCase(Fight.getBlueTeam().getName())){
|
||||
if(args[0].equalsIgnoreCase("tie")){
|
||||
FightSystem.setSpectateState(null, "Referee", "§7Kampfleiterentscheidung");
|
||||
}else if(args[0].equalsIgnoreCase(Fight.getBlueTeam().getName())){
|
||||
FightSystem.setSpectateState(Fight.getBlueTeam(), "Referee", "§7Kampfleiterentscheidung");
|
||||
}else if(args[0].equalsIgnoreCase(Fight.getRedTeam().getName())){
|
||||
Lixfel markierte diese Unterhaltung als gelöst
|
||||
FightSystem.setSpectateState(Fight.getRedTeam(), "Referee", "§7Kampfleiterentscheidung");
|
||||
}else if(args[0].equalsIgnoreCase("tie")){
|
||||
FightSystem.setSpectateState(null, "Referee", "§7Kampfleiterentscheidung");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -406,7 +406,7 @@ public class FightTeam {
|
||||
}
|
||||
|
||||
public double getCurrentHearts() {
|
||||
return players.values().stream().filter(FightPlayer::isLiving).map(fp -> fp.getPlayer().getHealth()).reduce(Double::sum).orElse(0.0);
|
||||
return players.values().stream().filter(FightPlayer::isLiving).mapToDouble(fp -> fp.getPlayer().getHealth()).sum();
|
||||
Lixfel markierte diese Unterhaltung als gelöst
Veraltet
YoyoNow
hat
Man kann auch Man kann auch `.mapToDouble(fp -> fp.getPlayer().getHealth()).sum()` nutzten, dann braucht man auch kein `orElse(0.0)` mehr.
|
||||
}
|
||||
|
||||
public double getHeartRatio(){
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package de.steamwar.fightsystem.utils;
|
||||
|
||||
import de.steamwar.core.TPSWatcher;
|
||||
import de.steamwar.fightsystem.ArenaMode;
|
||||
import de.steamwar.fightsystem.Config;
|
||||
import de.steamwar.fightsystem.FightSystem;
|
||||
@ -29,6 +30,8 @@ import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.StateDependentCountdown;
|
||||
import de.steamwar.fightsystem.states.StateDependentTask;
|
||||
import de.steamwar.fightsystem.winconditions.Wincondition;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -51,6 +54,7 @@ public class FightUI {
|
||||
public FightUI() {
|
||||
new StateDependentTask(ArenaMode.AntiReplay, FightState.All, this::update, 20, 20);
|
||||
new StateDependentTask(ArenaMode.All, FightState.All, this::sendToPlayers, 5, 5);
|
||||
new StateDependentTask(ArenaMode.All, FightState.All, this::tpsWatcher, 20, 20);
|
||||
instance = this;
|
||||
}
|
||||
|
||||
@ -132,6 +136,14 @@ public class FightUI {
|
||||
BountifulWrapper.impl.broadcastBossbar();
|
||||
}
|
||||
|
||||
private void tpsWatcher() {
|
||||
double tps = TPSWatcher.getTPS();
|
||||
if(tps < 15.0) {
|
||||
BaseComponent[] message = TextComponent.fromLegacyText("§c" + tps + " §7TPS");
|
||||
Bukkit.getOnlinePlayers().forEach(player -> BountifulWrapper.impl.toActionbar(player, message));
|
||||
}
|
||||
}
|
||||
|
||||
public enum BossBarType {
|
||||
BLUE_LEFT(345, 165),
|
||||
RED_LEFT(165, 345);
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Was wird passieren, wenn ein team tie heißt? dann kannst du kein tie mehr machen!