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 com.comphenix.tinyprotocol.TinyProtocol;
|
||||||
import de.steamwar.core.Core;
|
import de.steamwar.core.Core;
|
||||||
|
import de.steamwar.core.WorldIdentifier;
|
||||||
import de.steamwar.core.worldedit.SteamEdit;
|
import de.steamwar.core.worldedit.SteamEdit;
|
||||||
import de.steamwar.core.worldedit.WorldEditRendererCUIEditor;
|
import de.steamwar.core.worldedit.WorldEditRendererCUIEditor;
|
||||||
import de.steamwar.fightsystem.fight.Fight;
|
import de.steamwar.fightsystem.fight.Fight;
|
||||||
@@ -49,6 +50,9 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.player.PlayerPickupArrowEvent;
|
import org.bukkit.event.player.PlayerPickupArrowEvent;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.HexFormat;
|
||||||
|
|
||||||
public class FightSystem extends JavaPlugin {
|
public class FightSystem extends JavaPlugin {
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -79,6 +83,11 @@ public class FightSystem extends JavaPlugin {
|
|||||||
Core.setServerName("Replay");
|
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());
|
message = new Message("de.steamwar.fightsystem.FightSystem", FightSystem.class.getClassLoader());
|
||||||
|
|
||||||
spigotLinker = new SpigotLinker(this, message) {
|
spigotLinker = new SpigotLinker(this, message) {
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ public class ServerStarter {
|
|||||||
gameMode = mode.configFile.getName().replace(".yml", "");
|
gameMode = mode.configFile.getName().replace(".yml", "");
|
||||||
directory = new File(SERVER_PATH, mode.Server.Folder);
|
directory = new File(SERVER_PATH, mode.Server.Folder);
|
||||||
arguments.put("config", mode.configFile.getName());
|
arguments.put("config", mode.configFile.getName());
|
||||||
|
arguments.put("arenaMap", gameMode + "/" + map);
|
||||||
tempWorld(SERVER_PATH + mode.Server.Folder + "/arenas/" + map);
|
tempWorld(SERVER_PATH + mode.Server.Folder + "/arenas/" + map);
|
||||||
startCondition = () -> {
|
startCondition = () -> {
|
||||||
if (playersToSend.stream().anyMatch(player -> Subserver.isArena(Subserver.getSubserver(player)))) {
|
if (playersToSend.stream().anyMatch(player -> Subserver.isArena(Subserver.getSubserver(player)))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user