SteamWar/FightSystem
Archiviert
13
1

No paper server

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2021-04-03 20:59:11 +02:00
Ursprung 2705bda00d
Commit 78dc8ecca8
4 geänderte Dateien mit 30 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -46,5 +46,6 @@ public enum ArenaMode {
public static final Set<ArenaMode> VariableTeams = Collections.unmodifiableSet(EnumSet.complementOf(EnumSet.of(RANKED, EVENT)));
public static final Set<ArenaMode> RankedEvent = Collections.unmodifiableSet(EnumSet.of(RANKED, EVENT));
public static final Set<ArenaMode> Restartable = Collections.unmodifiableSet(EnumSet.of(NORMAL, RANKED));
public static final Set<ArenaMode> Fight = Collections.unmodifiableSet(EnumSet.of(NORMAL, RANKED, EVENT));
public static final Set<ArenaMode> SoloLeader = Collections.unmodifiableSet(EnumSet.of(TEST, CHECK, PREPARE));
}

Datei anzeigen

@ -22,6 +22,7 @@ package de.steamwar.fightsystem.countdown;
import de.steamwar.fightsystem.ArenaMode;
import de.steamwar.fightsystem.Config;
import de.steamwar.fightsystem.FightSystem;
import de.steamwar.fightsystem.fight.FightWorld;
import de.steamwar.fightsystem.states.FightState;
import de.steamwar.fightsystem.states.StateDependentCountdown;
@ -29,7 +30,11 @@ public class EventSpectateCountdown extends Countdown {
public EventSpectateCountdown() {
super(Config.SpectatorDuration, SWSound.BLOCK_NOTE_PLING, false);
new StateDependentCountdown(ArenaMode.Event, FightState.Spectate, this);
if(FightWorld.isPaper()){
new StateDependentCountdown(ArenaMode.Fight, FightState.Spectate, this);
}else{
new StateDependentCountdown(ArenaMode.Event, FightState.Spectate, this);
}
}
@Override

Datei anzeigen

@ -22,6 +22,7 @@ package de.steamwar.fightsystem.countdown;
import de.steamwar.fightsystem.ArenaMode;
import de.steamwar.fightsystem.Config;
import de.steamwar.fightsystem.FightSystem;
import de.steamwar.fightsystem.fight.FightWorld;
import de.steamwar.fightsystem.states.FightState;
import de.steamwar.fightsystem.states.StateDependentCountdown;
@ -29,7 +30,9 @@ public class SpectateOverCountdown extends Countdown {
public SpectateOverCountdown() {
super(Config.SpectatorDuration, SWSound.BLOCK_NOTE_PLING, false);
new StateDependentCountdown(ArenaMode.Restartable, FightState.Spectate, this);
if(!FightWorld.isPaper()){
new StateDependentCountdown(ArenaMode.Restartable, FightState.Spectate, this);
}
}
@Override

Datei anzeigen

@ -30,11 +30,25 @@ import org.bukkit.WorldCreator;
public class FightWorld extends StateDependent {
private static final boolean paper;
static{
boolean ispaper;
try {
Class.forName("com.destroystokyo.paper.PaperConfig");
ispaper = true;
} catch (ClassNotFoundException e) {
ispaper = false;
}
paper = ispaper;
}
private final World world = Bukkit.getWorlds().get(0);
public FightWorld() {
super(ArenaMode.Restartable, FightState.Schem);
register();
if(!isPaper())
register();
}
@Override
@ -42,6 +56,10 @@ public class FightWorld extends StateDependent {
//unused
}
public static boolean isPaper(){
return paper;
}
@Override
public void disable() {
World backup = new WorldCreator(world.getName() + "/backup").createWorld();