Archiviert
1
0

Fix some bugs + minor improvements

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2022-03-20 19:08:55 +01:00
Ursprung 58dd7486f7
Commit e2fd1754ce
5 geänderte Dateien mit 17 neuen und 13 gelöschten Zeilen

Datei anzeigen

@ -199,7 +199,7 @@ public class ServerStarter {
arguments.put("logPath", worldName); arguments.put("logPath", worldName);
Subserver subserver = constructor.construct(serverName, port, node.startServer( 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); ), worldCleanup);
for(ProxiedPlayer p : playersToSend) for(ProxiedPlayer p : playersToSend)

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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