No paper server
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
2705bda00d
Commit
78dc8ecca8
@ -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));
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren