Implementation of ELO-Based 1 vs 1 ranked games #172
@ -81,6 +81,7 @@ public class Config {
|
||||
public static final String TeamChatDetection;
|
||||
public static final UUID BlueLeader;
|
||||
public static final UUID RedLeader;
|
||||
public static final boolean Ranked;
|
||||
|
||||
//Active win conditions
|
||||
public static final boolean Timeout;
|
||||
@ -372,6 +373,7 @@ public class Config {
|
||||
RedLeader = null;
|
||||
|
||||
CheckSchemID = Integer.parseInt(System.getProperty("checkSchemID", "0"));
|
||||
Ranked = Boolean.parseBoolean(System.getProperty("ranked", "false"));
|
||||
}
|
||||
|
||||
public static boolean event(){
|
||||
|
@ -101,7 +101,7 @@ public class FightSystem extends JavaPlugin {
|
||||
|
||||
mainCountdown = new NoPlayersOnlineCountdown();
|
||||
|
||||
if(Config.event()) {
|
||||
if(Config.event() || Config.Ranked) {
|
||||
Objects.requireNonNull(getCommand("invite")).setExecutor(new EventDummyCommand());
|
||||
Objects.requireNonNull(getCommand("ready")).setExecutor(new EventDummyCommand());
|
||||
Objects.requireNonNull(getCommand("ak")).setExecutor(new EventDummyCommand());
|
||||
@ -196,8 +196,6 @@ public class FightSystem extends JavaPlugin {
|
||||
}
|
||||
|
||||
public static void setSpectateState(FightTeam winFightTeam, String windescription) {
|
||||
if(!fightState.ingame())
|
||||
throw new SecurityException(fightState.name());
|
||||
setFightState(FightState.SPECTATE);
|
||||
|
||||
setAllPlayersGM(GameMode.SPECTATOR);
|
||||
@ -222,6 +220,10 @@ public class FightSystem extends JavaPlugin {
|
||||
getEventFight().setErgebnis(2);
|
||||
}
|
||||
|
||||
if(Config.Ranked){
|
||||
//TODO
|
||||
}
|
||||
|
||||
if(!Config.test()){
|
||||
new SpectateOverCountdown();
|
||||
FightStatistics.saveStats(winFightTeam, windescription);
|
||||
|
@ -122,7 +122,7 @@ public class Fight {
|
||||
return;
|
||||
}
|
||||
|
||||
if(Config.IgnorePublicOnly || Config.event()){
|
||||
if(Config.IgnorePublicOnly || Config.event() || Config.Ranked){
|
||||
schemRank = 1000;
|
||||
return;
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import de.steamwar.fightsystem.IFightSystem;
|
||||
import de.steamwar.fightsystem.kit.KitManager;
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.utils.*;
|
||||
import de.steamwar.fightsystem.winconditions.RankedPlayerLeftWincondition;
|
||||
import de.steamwar.inventory.SWItem;
|
||||
import de.steamwar.sql.NoClipboardException;
|
||||
import de.steamwar.sql.PersonalKit;
|
||||
@ -194,6 +195,8 @@ public class FightTeam implements IFightTeam{
|
||||
if(!players.isEmpty()) {
|
||||
setLeader(players.iterator().next());
|
||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "§aDer Spieler §e" + this.leader.getPlayer().getName() + " §aist nun Leader von Team " + getColoredName() + "§a!");
|
||||
}else if(Config.Ranked){
|
||||
RankedPlayerLeftWincondition.leaderQuit(this);
|
||||
}else if(!Config.event()){
|
||||
FightSystem.shutdown(FightSystem.PREFIX + "§cTeam " + getColoredName() + " §chat keine Spieler mehr.\n Arena schließt...");
|
||||
}
|
||||
@ -209,7 +212,7 @@ public class FightTeam implements IFightTeam{
|
||||
else
|
||||
inventory.setItem(1, new ItemBuilder(Material.AIR).build());
|
||||
|
||||
if(!Config.event()){
|
||||
if(!Config.event() && !Config.Ranked){
|
||||
inventory.setItem(2, new ItemBuilder(Material.PAPER).removeAllAttributs().setDisplayName("§eSpieler einladen").build());
|
||||
inventory.setItem(3, new ItemBuilder(SWItem.getMaterial("FIREWORK_CHARGE")).removeAllAttributs().setDisplayName("§cSpieler rauswerfen").build());
|
||||
}
|
||||
|
@ -0,0 +1,13 @@
|
||||
package de.steamwar.fightsystem.winconditions;
|
||||
|
||||
import de.steamwar.fightsystem.FightSystem;
|
||||
import de.steamwar.fightsystem.fight.Fight;
|
||||
import de.steamwar.fightsystem.fight.FightTeam;
|
||||
|
||||
public class RankedPlayerLeftWincondition {
|
||||
|
||||
private RankedPlayerLeftWincondition(){}
|
||||
|
||||
public static void leaderQuit(FightTeam leaderlessTeam){
|
||||
FightSystem.setSpectateState(Fight.getOpposite(leaderlessTeam), "LeaderQuit");
|
||||
}
|
||||
}
|
In neuem Issue referenzieren
Einen Benutzer sperren
hast du vergessen "extends Wincondition" anzuhängen oder ist das absicht?
Absicht, weil static