forked from SteamWar/SteamWar
Add arena map name to world identifier
This commit is contained in:
@@ -21,6 +21,7 @@ package de.steamwar.fightsystem;
|
||||
|
||||
import com.comphenix.tinyprotocol.TinyProtocol;
|
||||
import de.steamwar.core.Core;
|
||||
import de.steamwar.core.WorldIdentifier;
|
||||
import de.steamwar.core.worldedit.SteamEdit;
|
||||
import de.steamwar.core.worldedit.WorldEditRendererCUIEditor;
|
||||
import de.steamwar.fightsystem.fight.Fight;
|
||||
@@ -49,6 +50,9 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerPickupArrowEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HexFormat;
|
||||
|
||||
public class FightSystem extends JavaPlugin {
|
||||
|
||||
@Getter
|
||||
@@ -79,6 +83,11 @@ public class FightSystem extends JavaPlugin {
|
||||
Core.setServerName("Replay");
|
||||
}
|
||||
|
||||
String arenaMap = System.getProperty("arenaMap");
|
||||
if (arenaMap != null) {
|
||||
WorldIdentifier.set("fight/" + HexFormat.of().formatHex(arenaMap.getBytes(StandardCharsets.UTF_8)));
|
||||
}
|
||||
|
||||
message = new Message("de.steamwar.fightsystem.FightSystem", FightSystem.class.getClassLoader());
|
||||
|
||||
spigotLinker = new SpigotLinker(this, message) {
|
||||
|
||||
@@ -91,6 +91,7 @@ public class ServerStarter {
|
||||
gameMode = mode.configFile.getName().replace(".yml", "");
|
||||
directory = new File(SERVER_PATH, mode.Server.Folder);
|
||||
arguments.put("config", mode.configFile.getName());
|
||||
arguments.put("arenaMap", gameMode + "/" + map);
|
||||
tempWorld(SERVER_PATH + mode.Server.Folder + "/arenas/" + map);
|
||||
startCondition = () -> {
|
||||
if (playersToSend.stream().anyMatch(player -> Subserver.isArena(Subserver.getSubserver(player)))) {
|
||||
|
||||
Reference in New Issue
Block a user