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