Splitting Setup #94
@ -18,11 +18,14 @@ public class Config {
|
||||
|
||||
private Config(){}
|
||||
|
||||
//Fight sequence durations
|
||||
//Fight sequence
|
||||
public static final int NoPlayerOnlineDuration;
|
||||
public static final int PreSchemPasteDuration;
|
||||
public static final int SetupDuration;
|
||||
public static final int PreFightDuration;
|
||||
public static final int EnterPhaseBegin;
|
||||
public static final int SpectatorDuration;
|
||||
public static final boolean Entern;
|
||||
|
||||
//arena parameter
|
||||
public static final int SchemsizeX;
|
||||
@ -82,14 +85,12 @@ public class Config {
|
||||
public static final boolean PercentSystem;
|
||||
public static final boolean RelativePercent;
|
||||
public static final boolean Points;
|
||||
public static final boolean Entern;
|
||||
public static final boolean TechKO;
|
||||
public static final boolean WaterTechKO;
|
||||
public static final boolean PumpkinTechKO;
|
||||
|
||||
//win condition parameters
|
||||
public static final int TimeoutTime;
|
||||
public static final int EnterPhaseBegin;
|
||||
public static final double PercentWin;
|
||||
public static final List<String> IgnoredBlocks;
|
||||
|
||||
@ -126,6 +127,7 @@ public class Config {
|
||||
FileConfiguration worldconfig = YamlConfiguration.loadConfiguration(worldConfigFile);
|
||||
|
||||
NoPlayerOnlineDuration = config.getInt("Times.NoPlayersOnlineDuration");
|
||||
PreSchemPasteDuration = config.getInt("Times.PreSchemPasteDuration");
|
||||
SetupDuration = config.getInt("Times.SetupDuration");
|
||||
PreFightDuration = config.getInt("Times.PreFightDuration");
|
||||
SpectatorDuration = config.getInt("Times.SpectatorDuration");
|
||||
|
@ -108,7 +108,7 @@ public class FightSystem extends JavaPlugin {
|
||||
throw new SecurityException(fightState.name());
|
||||
setFightState(FightState.PRE_SCHEM_SETUP);
|
||||
|
||||
mainCountdown = new SetupOverCountdown();
|
||||
mainCountdown = new PreSchemPasteCountdown();
|
||||
}
|
||||
|
||||
public static void setPostSchemState() {
|
||||
@ -275,8 +275,10 @@ public class FightSystem extends JavaPlugin {
|
||||
|
||||
private static void setFightState(FightState state){
|
||||
fightState = state;
|
||||
if(mainCountdown != null)
|
||||
if(mainCountdown != null){
|
||||
mainCountdown.disable();
|
||||
mainCountdown = null;
|
||||
}
|
||||
postStateChange();
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
package de.steamwar.fightsystem.countdown;
|
||||
|
||||
import de.steamwar.fightsystem.Config;
|
||||
import de.steamwar.fightsystem.FightSystem;
|
||||
import de.steamwar.fightsystem.fight.Fight;
|
||||
import de.steamwar.fightsystem.fight.FightTeam;
|
||||
|
||||
public class PreSchemPasteCountdown extends Countdown {
|
||||
|
||||
public PreSchemPasteCountdown() {
|
||||
super(Config.PreSchemPasteDuration, SWSound.BLOCK_NOTE_PLING, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
String countdownCounting() {
|
||||
return "bis eine Public-Schematic gewählt wird!";
|
||||
}
|
||||
|
||||
@Override
|
||||
void countdownFinished() {
|
||||
checkTeam(Fight.getBlueTeam());
|
||||
checkTeam(Fight.getRedTeam());
|
||||
FightSystem.setPostSchemState();
|
||||
}
|
||||
|
||||
private void checkTeam(FightTeam team){
|
||||
if(!team.hasSchematic())
|
||||
team.pasteDummy();
|
||||
}
|
||||
}
|
@ -271,6 +271,9 @@ public class FightTeam implements IFightTeam{
|
||||
|
||||
schematic = publics.get(new Random().nextInt(publics.size()));
|
||||
pasteSchematic();
|
||||
|
||||
if(!Config.test() && leader != null)
|
||||
leader.getPlayer().getInventory().clear(0);
|
||||
}
|
||||
|
||||
public void setSchematic(Schematic schematic){
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren