SteamWar/BungeeCore
Archiviert
13
2

Server start refactoring, Tutorial system #317

Zusammengeführt
Lixfel hat 6 Commits von tutorial nach master 2022-03-22 09:28:16 +01:00 zusammengeführt
5 geänderte Dateien mit 17 neuen und 13 gelöschten Zeilen
Nur Änderungen aus Commit e2fd1754ce werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -199,7 +199,7 @@ public class ServerStarter {
arguments.put("logPath", worldName);
Subserver subserver = constructor.construct(serverName, port, node.startServer(
serverJar, directory, worldDir, worldName, port, xmx, (String[]) arguments.entrySet().stream().map(entry -> entry.getKey() + "=" + entry.getValue()).toArray()
serverJar, directory, worldDir, worldName, port, xmx, arguments.entrySet().stream().map(entry -> entry.getKey() + "=" + entry.getValue()).toArray(String[]::new)
), worldCleanup);
for(ProxiedPlayer p : playersToSend)

Datei anzeigen

@ -20,6 +20,7 @@
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.inventory.SWInventory;
import de.steamwar.bungeecore.inventory.SWItem;
import de.steamwar.bungeecore.inventory.SWListInv;
import de.steamwar.bungeecore.inventory.SWStreamInv;
@ -95,6 +96,7 @@ public class TutorialCommand extends BasicCommand {
List<String> lore = new ArrayList<>();
lore.add(Message.parse("TUTORIAL_BY", player, tutorial.creator().getUserName()));
lore.add(Message.parse("TUTORIAL_STARS", player, tutorial.stars()));
item.setLore(lore);
return item;
@ -106,6 +108,7 @@ public class TutorialCommand extends BasicCommand {
new SWListInv<>(player, Message.parse("TUTORIAL_RATE_TITLE", player), Arrays.stream(rates).mapToObj(rate -> new SWListInv.SWListEntry<>(new SWItem("NETHER_STAR", Message.parse("TUTORIAL_RATE", player, rate)), rate)).collect(Collectors.toList()), (click, rate) -> {
tutorial.rate(user, rate);
SWInventory.close(player);
}).open();
}
@ -121,7 +124,7 @@ public class TutorialCommand extends BasicCommand {
subserver.execute("save-all");
try {
Thread.sleep(500);
Thread.sleep(1000);
} catch (InterruptedException e) {
BungeeCore.get().getLogger().log(Level.WARNING, "Tutorial creation interrupted", e);
Thread.currentThread().interrupt();

Datei anzeigen

@ -116,6 +116,10 @@ public class SWInventory {
}
public void close() {
close(player);
}
public static void close(ProxiedPlayer player) {
new CloseInventoryPacket(SteamwarUser.get(player).getId()).send(player);
}

Datei anzeigen

@ -65,25 +65,21 @@ public class Tutorial {
private final int creator;
private final String name;
private final String item;
private final int stars;
private final double stars;
public Tutorial(ResultSet rs) throws SQLException {
this(rs.getInt("TutorialID"), rs.getInt("Creator"), rs.getString("Name"), rs.getString("Item"), rs.getInt("Stars"));
}
private Tutorial(int id, int creator, String name, String item, int stars) {
this.id = id;
this.creator = creator;
this.name = name;
this.item = item;
this.stars = stars;
this.id = rs.getInt("TutorialID");
this.creator = rs.getInt("Creator");
this.name = rs.getString("Name");
this.item = rs.getString("Item");
this.stars = rs.getDouble("Stars");
}
public SteamwarUser creator() {
return SteamwarUser.get(creator);
}
public int stars() {
public double stars() {
return stars;
}

Datei anzeigen

@ -337,6 +337,7 @@ REPLAY_SERVER=§7{0}
TUTORIAL_TITLE=Tutorials
TUTORIAL_NAME=§e{0}
TUTORIAL_BY=§8von §7{0}
TUTORIAL_STARS=§e{0} §7Sterne
TUTORIAL_RATE_TITLE=Tutorial bewerten
TUTORIAL_RATE=§e{0} §7Stern(e)
TUTORIAL_CREATE_HELP=§8/§7tutorial create §8[§eMaterial§8] §8[§eName§8]