SteamWar/MissileWars
Archiviert
13
0

Add Basic challenge functions

Dieser Commit ist enthalten in:
jojo 2020-12-18 23:19:10 +01:00
Ursprung ea3181cc03
Commit 7dd543dab5
2 geänderte Dateien mit 15 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -26,6 +26,7 @@ import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
import java.util.UUID;
import java.util.logging.Level;
public class Config {
@ -50,7 +51,8 @@ public class Config {
public static final double MissileChance;
private static final int EventKampfID;
public static final UUID BlueLeader;
public static final UUID RedLeader;
static {
File configfile = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "config.yml");
@ -86,11 +88,20 @@ public class Config {
BluePortalZ = blue.getInt("PortalZ");
BlueSpawn = new Location(Bukkit.getWorlds().get(0), blue.getDouble("SpawnX"), blue.getDouble("SpawnY"), blue.getDouble("SpawnZ"), (float)blue.getDouble("SpawnYaw"), (float)blue.getDouble("SpawnPitch"));
EventKampfID = Integer.parseInt(System.getProperty("fightID", "0"));
String blueLeader = System.getProperty("blueLeader", null);
String redLeader = System.getProperty("redLeader", null);
if(blueLeader != null)
BlueLeader = UUID.fromString(blueLeader);
else
BlueLeader = null;
if(redLeader != null)
RedLeader = UUID.fromString(redLeader);
else
RedLeader = null;
}
public static boolean test() {
return EventKampfID == -1;
public boolean isChallenge() {
return BlueLeader != null && RedLeader != null;
}
}

Datei anzeigen

@ -118,8 +118,6 @@ public class MWTeam {
p.setDisplayName(color + p.getName());
if (MissileWars.getFightState() == FightState.WAITING && !enemy().players.isEmpty())
MissileWars.startRound();
if (!Config.test())
Bukkit.getScheduler().runTaskLater(MissileWars.getPlugin(), () -> new TablistNamePacket(SteamwarUser.get(p.getUniqueId()).getId(), color + p.getName()).send(p), 5);
}
public void leave(Player p) {