SteamWar/FightSystem
Archiviert
13
1

No paper world reset #251

Manuell gemergt
Lixfel hat 1 Commits von noPaperWorld nach master 2021-04-05 16:17:25 +02:00 zusammengeführt
4 geänderte Dateien mit 30 neuen und 3 gelöschten Zeilen
Nur Änderungen aus Commit 78dc8ecca8 werden angezeigt - Alle Commits anzeigen

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> 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> RankedEvent = Collections.unmodifiableSet(EnumSet.of(RANKED, EVENT));
public static final Set<ArenaMode> Restartable = Collections.unmodifiableSet(EnumSet.of(NORMAL, RANKED)); 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)); 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.ArenaMode;
import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.Config;
import de.steamwar.fightsystem.FightSystem; import de.steamwar.fightsystem.FightSystem;
import de.steamwar.fightsystem.fight.FightWorld;
import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.FightState;
import de.steamwar.fightsystem.states.StateDependentCountdown; import de.steamwar.fightsystem.states.StateDependentCountdown;
@ -29,8 +30,12 @@ public class EventSpectateCountdown extends Countdown {
public EventSpectateCountdown() { public EventSpectateCountdown() {
super(Config.SpectatorDuration, SWSound.BLOCK_NOTE_PLING, false); super(Config.SpectatorDuration, SWSound.BLOCK_NOTE_PLING, false);
if(FightWorld.isPaper()){
new StateDependentCountdown(ArenaMode.Fight, FightState.Spectate, this);
}else{
new StateDependentCountdown(ArenaMode.Event, FightState.Spectate, this); new StateDependentCountdown(ArenaMode.Event, FightState.Spectate, this);
} }
}
@Override @Override
public String countdownCounting() { public String countdownCounting() {

Datei anzeigen

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

Datei anzeigen

@ -30,10 +30,24 @@ import org.bukkit.WorldCreator;
public class FightWorld extends StateDependent { 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); private final World world = Bukkit.getWorlds().get(0);
public FightWorld() { public FightWorld() {
super(ArenaMode.Restartable, FightState.Schem); super(ArenaMode.Restartable, FightState.Schem);
if(!isPaper())
register(); register();
} }
@ -42,6 +56,10 @@ public class FightWorld extends StateDependent {
//unused //unused
} }
public static boolean isPaper(){
return paper;
}
@Override @Override
public void disable() { public void disable() {
World backup = new WorldCreator(world.getName() + "/backup").createWorld(); World backup = new WorldCreator(world.getName() + "/backup").createWorld();