First fightable version #2
Dieser Commit ist enthalten in:
Ursprung
e99470fec5
Commit
47c8153fe0
@ -4,6 +4,7 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@ -28,13 +29,13 @@ public class Config {
|
|||||||
public static final int EndTime;
|
public static final int EndTime;
|
||||||
|
|
||||||
static{
|
static{
|
||||||
if(!new File(MissileWars.getPlugin().getDataFolder(), "config.yml").exists()){
|
File configfile = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "config.yml");
|
||||||
MissileWars.getPlugin().saveDefaultConfig();
|
if(!configfile.exists()){
|
||||||
Bukkit.getLogger().log(Level.SEVERE, "Config fehlt!");
|
Bukkit.getLogger().log(Level.SEVERE, "Config fehlt!");
|
||||||
Bukkit.shutdown();
|
Bukkit.shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
FileConfiguration config = MissileWars.getPlugin().getConfig();
|
FileConfiguration config = YamlConfiguration.loadConfiguration(configfile);
|
||||||
WaitingTime = config.getInt("WaitingTime");
|
WaitingTime = config.getInt("WaitingTime");
|
||||||
ItemTime = config.getInt("ItemTime");
|
ItemTime = config.getInt("ItemTime");
|
||||||
ShieldFlyTime = config.getInt("ShieldFlyTime");
|
ShieldFlyTime = config.getInt("ShieldFlyTime");
|
||||||
|
@ -61,7 +61,7 @@ public class MWTeam {
|
|||||||
Bukkit.getScheduler().runTaskLater(MissileWars.getPlugin(), () -> p.setGameMode(GameMode.SURVIVAL), 1);
|
Bukkit.getScheduler().runTaskLater(MissileWars.getPlugin(), () -> p.setGameMode(GameMode.SURVIVAL), 1);
|
||||||
p.getInventory().setItem(0, bow);
|
p.getInventory().setItem(0, bow);
|
||||||
sbteam.addPlayer(p);
|
sbteam.addPlayer(p);
|
||||||
p.setDisplayName(color + " " + p.getName());
|
p.setDisplayName(color + p.getName());
|
||||||
if (MissileWars.getFightState() == FightState.WAITING && !enemy().getPlayers().isEmpty())
|
if (MissileWars.getFightState() == FightState.WAITING && !enemy().getPlayers().isEmpty())
|
||||||
MissileWars.startRound();
|
MissileWars.startRound();
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren