Add arena map name to world identifier

This commit is contained in:
Jakob Schulz
2026-10-16 23:00:38 +02:00
parent ad1b2c3185
commit 99f94c5278
2 changed files with 10 additions and 0 deletions
@@ -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)))) {