SteamWar/BungeeCore
Archiviert
13
2

1.19 Build server #366

Zusammengeführt
Lixfel hat 1 Commits von bau19 nach master 2022-06-11 20:41:18 +02:00 zusammengeführt
2 geänderte Dateien mit 12 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -26,7 +26,7 @@ public class ServerStarter {
private static final String EVENT_PATH = BACKBONE + "event/";
public static final String TEMP_WORLD_PATH = BACKBONE + "arenaserver/";
public static final String TUTORIAL_PATH = BACKBONE + "tutorials/";
public static final String WORLDS18_PATH = BACKBONE + "userworlds18/";
public static final String WORLDS19_PATH = BACKBONE + "userworlds19/";
private File directory = null;
private String worldDir = null;
@ -109,10 +109,10 @@ public class ServerStarter {
return this;
}
public ServerStarter build18(UUID owner) {
directory = new File(SERVER_PATH, "Bau18");
serverJar = "paper-1.18.2.jar";
worldDir = WORLDS18_PATH;
public ServerStarter build19(UUID owner) {
directory = new File(SERVER_PATH, "Bau19");
serverJar = "paper-1.19.jar";
worldDir = WORLDS19_PATH;
worldName = String.valueOf(SteamwarUser.get(owner).getId());
buildWithWorld(owner, new File(directory, "Bauwelt").getPath());
return this;

Datei anzeigen

@ -46,7 +46,7 @@ public class BauCommand extends BasicCommand {
ProxiedPlayer p = (ProxiedPlayer) sender;
versionSelector(p, args, 0,
() -> new ServerStarter().build18(p.getUniqueId()).send(p).start(),
() -> new ServerStarter().build19(p.getUniqueId()).send(p).start(),
() -> new ServerStarter().build15(p.getUniqueId()).send(p).start(),
() -> new ServerStarter().build12(p.getUniqueId()).send(p).start(),
() -> {
@ -128,13 +128,13 @@ public class BauCommand extends BasicCommand {
}
versionSelector(p, args, 2,
() -> new ServerStarter().build18(worldOwner.getUuid()).send(p).start(),
() -> new ServerStarter().build19(worldOwner.getUuid()).send(p).start(),
() -> new ServerStarter().build15(worldOwner.getUuid()).send(p).start(),
() -> new ServerStarter().build12(worldOwner.getUuid()).send(p).start(),
() -> HelpCommand.sendBauHelp(ChatSender.of(p)));
}
private static void versionSelector(ProxiedPlayer p, String[] args, int pos, Runnable run18, Runnable run15, Runnable run12, Runnable runElse) {
private static void versionSelector(ProxiedPlayer p, String[] args, int pos, Runnable run19, Runnable run15, Runnable run12, Runnable runElse) {
if(args.length <= pos) {
int version = p.getPendingConnection().getVersion();
if(version > 340) { // Version > 1.12.2
@ -146,9 +146,11 @@ public class BauCommand extends BasicCommand {
}
switch (args[pos].toLowerCase()) {
case "19":
case "1.19":
case "18":
case "1.18":
run18.run();
run19.run();
break;
case "ws":
case "warship":
@ -231,7 +233,7 @@ public class BauCommand extends BasicCommand {
private static void delete(ProxiedPlayer p, String[] args){
SteamwarUser user = SteamwarUser.get(p.getUniqueId());
versionSelector(p, args, 1,
() -> deleteConfirmation(p, () -> deleteWorld(p, ServerStarter.WORLDS18_PATH + user.getId())),
() -> deleteConfirmation(p, () -> deleteWorld(p, ServerStarter.WORLDS19_PATH + user.getId())),
() -> deleteConfirmation(p, () -> deleteWorld(p, BungeeCore.USERWORLDS15 + user.getId())),
() -> deleteConfirmation(p, () -> deleteWorld(p, BungeeCore.WORLD_FOLDER + p.getUniqueId().toString())),
() -> HelpCommand.sendBauHelp(ChatSender.of(p)));