diff --git a/BauSystem/BauSystem_Main/build.gradle.kts b/BauSystem/BauSystem_Main/build.gradle.kts
index 8f46699d..5b8f0a89 100644
--- a/BauSystem/BauSystem_Main/build.gradle.kts
+++ b/BauSystem/BauSystem_Main/build.gradle.kts
@@ -38,7 +38,6 @@ dependencies {
compileOnly(libs.spigotapi)
compileOnly(libs.axiom)
compileOnly(libs.authlib)
- compileOnly(libs.viaapi)
compileOnly(libs.fawe18)
diff --git a/BauSystem/BauSystem_Main/src/BauSystem.properties b/BauSystem/BauSystem_Main/src/BauSystem.properties
index c9116dce..929d0c67 100644
--- a/BauSystem/BauSystem_Main/src/BauSystem.properties
+++ b/BauSystem/BauSystem_Main/src/BauSystem.properties
@@ -1013,6 +1013,4 @@ XRAY_OFF=§cXray deactivated
COLORREPLACE_HELP=§8//§ecolorreplace §8[§7color§8] §8[§7color§8] §8- §7Replace all blocks of one color with another
TYPEREPLACE_HELP=§8//§etypereplace §8[§7type§8] §8[§7type§8] §8- §7Replace all blocks of one type with another
# Schematic
-SCHEMATIC_GUI_ITEM=§eSchematics
-#VersionAnnouncer
-SERVER_VERSION=§7This server runs on Minecraft version §e{0}
\ No newline at end of file
+SCHEMATIC_GUI_ITEM=§eSchematics
\ No newline at end of file
diff --git a/BauSystem/BauSystem_Main/src/BauSystem_de.properties b/BauSystem/BauSystem_Main/src/BauSystem_de.properties
index 45e60f84..4cb20d95 100644
--- a/BauSystem/BauSystem_Main/src/BauSystem_de.properties
+++ b/BauSystem/BauSystem_Main/src/BauSystem_de.properties
@@ -954,6 +954,4 @@ XRAY_OFF=§cXray deaktiviert
COLORREPLACE_HELP=§8//§ecolorreplace §8[§7color§8] §8[§7color§8] §8- §7Ersetzt eine Farbe mit einer anderen
TYPEREPLACE_HELP=§8//§etyreplace §8[§7type§8] §8[§7type§8] §8- §7Ersetzt einen Blockgruppe mit einer anderen
# Schematics
-SCHEMATIC_GUI_ITEM=§eSchematics
-#VersionAnnouncer
-SERVER_VERSION=§7Dieser Server läuft auf Minecraft-Version §e{0}
\ No newline at end of file
+SCHEMATIC_GUI_ITEM=§eSchematics
\ No newline at end of file
diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/EventListener.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/EventListener.java
index 3eb099aa..4c5feada 100644
--- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/EventListener.java
+++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/EventListener.java
@@ -24,7 +24,6 @@ import de.steamwar.bausystem.Permission;
import de.steamwar.bausystem.features.script.ScriptRunner;
import de.steamwar.bausystem.features.script.lua.SteamWarGlobalLuaPlugin;
import de.steamwar.bausystem.features.script.lua.libs.StorageLib;
-import de.steamwar.bausystem.features.tpslimit.TPSUtils;
import de.steamwar.bausystem.region.Region;
import de.steamwar.bausystem.region.utils.RegionExtensionType;
import de.steamwar.bausystem.region.utils.RegionType;
@@ -32,7 +31,6 @@ import de.steamwar.core.TrickyTrialsWrapper;
import de.steamwar.linkage.Linked;
import org.bukkit.Bukkit;
import org.bukkit.Material;
-import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@@ -72,9 +70,10 @@ public class EventListener implements Listener {
@EventHandler(priority = EventPriority.HIGH)
public void onPlayerQuit(PlayerQuitEvent event) {
+ if(Permission.BUILD.hasPermission(event.getPlayer())) {
+ ScriptRunner.callEvent(event.getPlayer(), SteamWarGlobalLuaPlugin.EventType.SelfLeave, LuaValue.NIL, event);
+ }
StorageLib.removePlayer(event.getPlayer());
- if(!Permission.BUILD.hasPermission(event.getPlayer())) return;
- ScriptRunner.callEvent(event.getPlayer(), SteamWarGlobalLuaPlugin.EventType.SelfLeave, LuaValue.NIL, event);
}
@EventHandler(priority = EventPriority.HIGH)
diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/utils/VersionAnnouncer.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/utils/VersionAnnouncer.java
deleted file mode 100644
index ee9e91be..00000000
--- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/utils/VersionAnnouncer.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2024 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.utils;
-
-import com.viaversion.viaversion.api.Via;
-import com.viaversion.viaversion.api.ViaAPI;
-import de.steamwar.bausystem.BauSystem;
-import de.steamwar.linkage.Linked;
-import net.md_5.bungee.api.ChatMessageType;
-import org.bukkit.Bukkit;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.Listener;
-import org.bukkit.event.player.PlayerJoinEvent;
-
-@Linked
-public class VersionAnnouncer implements Listener {
-
- private final String versionString = Bukkit.getBukkitVersion().split("-", 2)[0];
-
- @SuppressWarnings("unchecked")
- private final ViaAPI via = Via.getAPI();
-
- @EventHandler
- public void onJoin(PlayerJoinEvent event) {
- Player player = event.getPlayer();
- if(via.getServerVersion().supportedVersions().contains(via.getPlayerVersion(player)))
- return;
-
- BauSystem.MESSAGE.sendPrefixless("SERVER_VERSION", player, ChatMessageType.ACTION_BAR, versionString);
- }
-}
diff --git a/BauSystem/BauSystem_Main/src/plugin.yml b/BauSystem/BauSystem_Main/src/plugin.yml
index 53585eaa..71b08d95 100644
--- a/BauSystem/BauSystem_Main/src/plugin.yml
+++ b/BauSystem/BauSystem_Main/src/plugin.yml
@@ -2,8 +2,6 @@ name: BauSystem
authors: [ Lixfel, YoyoNow, Chaoscaot, Zeanon, D4rkr34lm ]
version: "2.0"
depend: [ WorldEdit, SpigotCore ]
-softdepend:
- - ViaVersion
load: POSTWORLD
main: de.steamwar.bausystem.BauSystem
api-version: "1.13"
diff --git a/CommonCore/SQL/src/de/steamwar/sql/NodeData.java b/CommonCore/SQL/src/de/steamwar/sql/NodeData.java
index 52743811..0de6c6c5 100644
--- a/CommonCore/SQL/src/de/steamwar/sql/NodeData.java
+++ b/CommonCore/SQL/src/de/steamwar/sql/NodeData.java
@@ -28,12 +28,15 @@ import java.sql.PreparedStatement;
import java.util.zip.GZIPInputStream;
@AllArgsConstructor
+@Getter
public class NodeData {
static {
new SqlTypeMapper<>(PipedInputStream.class, "BLOB", (rs, identifier) -> { throw new SecurityException("PipedInputStream is write only datatype"); }, PreparedStatement::setBinaryStream);
new SqlTypeMapper<>(ByteArrayInputStream.class, "BLOB", (rs, identifier) -> { throw new SecurityException("ByteArrayInputStream is write only datatype"); }, PreparedStatement::setBinaryStream);
new SqlTypeMapper<>(BufferedInputStream.class, "BLOB", (rs, identifier) -> { throw new SecurityException("BufferedInputStream is write only datatype"); }, PreparedStatement::setBinaryStream);
+
+ SqlTypeMapper.ordinalEnumMapper(SchematicFormat.class);
}
private static final Table table = new Table<>(NodeData.class);
@@ -48,19 +51,18 @@ public class NodeData {
throw new IllegalArgumentException("Node is a directory");
return get.select(rs -> {
if(rs.next()) {
- return new NodeData(node.getId(), rs.getBoolean("NodeFormat"));
+ return new NodeData(node.getId(), SchematicFormat.values()[rs.getInt("NodeFormat")]);
} else {
- return new NodeData(node.getId(), false);
+ return new NodeData(node.getId(), SchematicFormat.MCEDIT);
}
}, node);
}
- @Getter
@Field(keys = {Table.PRIMARY})
private final int nodeId;
@Field
- private boolean nodeFormat;
+ private SchematicFormat nodeFormat;
public InputStream schemData() throws IOException {
try {
@@ -81,12 +83,18 @@ public class NodeData {
}
}
- public void saveFromStream(InputStream blob, boolean newFormat) {
+ public void saveFromStream(InputStream blob, SchematicFormat newFormat) {
updateDatabase.update(nodeId, newFormat, blob);
nodeFormat = newFormat;
}
- public boolean getNodeFormat() {
- return nodeFormat;
+ @AllArgsConstructor
+ @Getter
+ public enum SchematicFormat {
+ MCEDIT(".schematic"),
+ SPONGE_V2(".schem"),
+ SPONGE_V3(".schem");
+
+ private final String fileEnding;
}
}
diff --git a/CommonCore/SQL/src/de/steamwar/sql/SchematicNode.java b/CommonCore/SQL/src/de/steamwar/sql/SchematicNode.java
index 3df740da..bece8549 100644
--- a/CommonCore/SQL/src/de/steamwar/sql/SchematicNode.java
+++ b/CommonCore/SQL/src/de/steamwar/sql/SchematicNode.java
@@ -375,11 +375,10 @@ public class SchematicNode {
return nodeType == null;
}
- @Deprecated
- public boolean getSchemFormat() {
+ public String getFileEnding() {
if(isDir())
throw new SecurityException("Node is Directory");
- return NodeData.get(this).getNodeFormat();
+ return NodeData.get(this).getNodeFormat().getFileEnding();
}
public int getRank() {
diff --git a/CommonCore/SQL/src/de/steamwar/sql/SteamwarUser.java b/CommonCore/SQL/src/de/steamwar/sql/SteamwarUser.java
index 96974c61..d5b87b6e 100644
--- a/CommonCore/SQL/src/de/steamwar/sql/SteamwarUser.java
+++ b/CommonCore/SQL/src/de/steamwar/sql/SteamwarUser.java
@@ -73,6 +73,7 @@ public class SteamwarUser {
private static final Statement getPlaytime = new Statement("SELECT SUM(UNIX_TIMESTAMP(EndTime) - UNIX_TIMESTAMP(StartTime)) as Playtime FROM Session WHERE UserID = ?");
private static final Statement getFirstjoin = new Statement("SELECT MIN(StartTime) AS FirstJoin FROM Session WHERE UserID = ?");
+ private static final Statement getLastonline = new Statement("SELECT MAX(EndTime) AS LastOnline FROM Session WHERE UserID = ?");
private static final Map usersById = new HashMap<>();
private static final Map usersByUUID = new HashMap<>();
@@ -276,6 +277,14 @@ public class SteamwarUser {
}, id);
}
+ public Timestamp getLastOnline() {
+ return getLastonline.select(rs -> {
+ if (rs.next())
+ return rs.getTimestamp("LastOnline");
+ return null;
+ }, id);
+ }
+
public void punish(Punishment.PunishmentType punishment, Timestamp time, String banReason, int from, boolean perma) {
initPunishments();
punishments.remove(punishment);
diff --git a/FightSystem/FightSystem_14/src/de/steamwar/fightsystem/utils/WorldeditWrapper14.java b/FightSystem/FightSystem_14/src/de/steamwar/fightsystem/utils/WorldeditWrapper14.java
index 288b89e8..9a0ae4b5 100644
--- a/FightSystem/FightSystem_14/src/de/steamwar/fightsystem/utils/WorldeditWrapper14.java
+++ b/FightSystem/FightSystem_14/src/de/steamwar/fightsystem/utils/WorldeditWrapper14.java
@@ -42,6 +42,7 @@ import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockTypes;
import de.steamwar.fightsystem.Config;
import de.steamwar.fightsystem.FightSystem;
+import de.steamwar.sql.NodeData;
import de.steamwar.sql.SchematicData;
import de.steamwar.sql.SchematicNode;
import org.bukkit.DyeColor;
@@ -144,6 +145,6 @@ public class WorldeditWrapper14 implements WorldeditWrapper {
throw new SecurityException(e);
}
- new SchematicData(schem).saveFromBytes(outputStream.toByteArray(), true);
+ new SchematicData(schem).saveFromBytes(outputStream.toByteArray(), NodeData.SchematicFormat.SPONGE_V2);
}
}
diff --git a/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/WorldeditWrapper8.java b/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/WorldeditWrapper8.java
index 19854db8..018552f2 100644
--- a/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/WorldeditWrapper8.java
+++ b/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/WorldeditWrapper8.java
@@ -39,6 +39,7 @@ import com.sk89q.worldedit.session.ClipboardHolder;
import com.sk89q.worldedit.world.World;
import de.steamwar.fightsystem.Config;
import de.steamwar.fightsystem.FightSystem;
+import de.steamwar.sql.NodeData;
import de.steamwar.sql.SchematicData;
import de.steamwar.sql.SchematicNode;
import org.bukkit.DyeColor;
@@ -142,6 +143,6 @@ public class WorldeditWrapper8 implements WorldeditWrapper {
throw new SecurityException(e);
}
- new SchematicData(schem).saveFromBytes(outputStream.toByteArray(), false);
+ new SchematicData(schem).saveFromBytes(outputStream.toByteArray(), NodeData.SchematicFormat.MCEDIT);
}
}
diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java
index 6e6b1c40..57400063 100644
--- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java
+++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java
@@ -153,7 +153,6 @@ public class FightSystem extends JavaPlugin {
new GamemodeCommand();
new ReadyCommand();
new AkCommand();
- new LeaderCommand();
new LockschemCommand();
new StateCommand();
new SkipCommand();
diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties
index 9f80ab7e..3d9a9218 100644
--- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties
+++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties
@@ -34,9 +34,6 @@ GAMEMODE_NOT_ALLOWED=§cChanging gamemode is not permitted
GAMEMODE_UNKNOWN=§cUnknown gamemode {0}
GAMEMODE_HELP=§8/§7gm §8[§egamemode§8]
-LEADER_FULL=§cAll teams already have a leader
-ALREADY_IN_TEAM=§cYou are already in a team
-
LOCKSCHEM_HELP=§8/§7lockschem §8[§eteam§8]
UNKNOWN_TEAM=§cThis team does not exist
LOCKSCHEM_LOCKED=§7Schematic locked
@@ -65,7 +62,9 @@ STATE_RUNNING=§eFighting phase
STATE_SPECTATE_WIN=§7Victory {0}
STATE_SPECTATE_TIE=§7Draw
-REMOVE_TITLE=Kick player
+MANAGE_TITLE=Manage players
+MANAGE_LORE1=§eLeft §7click§8: §ekick
+MANAGE_LORE2=§eRight §7click§8: §epromote
KIT_SELECTION_TITLE=Kit selection
KIT_NO_KITS=§cNo kits found
@@ -113,7 +112,7 @@ SKIP_NOT_READY=§c§mSkipping to next event
TEAM_CHAT={0}{1}§8» {0}{2}
CHOOSE_KIT=§eChoose kit
RESPAWN=§eRespawn
-REMOVE_PLAYERS=§cKick player
+MANAGE_PLAYERS=§cManage players
CHOOSE_SCHEMATIC=§eChoose {0}
SCHEMATIC_REQUIRED=§cChoose a schematic first
ADD_AI=§eAdd AI
@@ -141,7 +140,6 @@ NO_TELEPORT=§cYou are not allowed to use this teleport function
OPEN_INVENTORY_TO_CUSTOMIZE=§eOpen inventory to customize your kit
NO_ENTERN=§cYou may not board
NO_TEAMAREA=§cYou are not allowed in the team area
-TEST_BECOME_LEADER=§7Become a team leader with §8/§eleader
PREPARE_SCHEM_DELETED=§cApparently the schematic to be submitted was deleted. submission aborted.
PREPARE_SCHEM_EXISTS=§cThere is already a schematic with the suffix -prepared, please rename or delete it, submission aborted.
PREPARE_ACTIVE_PISTON=§cMoving pistons were found in the team area, submission aborted.
diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties
index 6723bcfb..d45cdfd0 100644
--- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties
+++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties
@@ -32,9 +32,6 @@ GAMEMODE_NOT_ALLOWED=§cSpielmodusänderung verboten
GAMEMODE_UNKNOWN=§cUnbekannter Spielmodus {0}
GAMEMODE_HELP=§8/§7gm §8[§eSpielmodus§8]
-LEADER_FULL=§cAlle Teams haben bereits einen Leader
-ALREADY_IN_TEAM=§cDu bist bereits in einem Team
-
LOCKSCHEM_HELP=§8/§7lockschem §8[§eTeam§8]
UNKNOWN_TEAM=§cDieses Team existiert nicht
LOCKSCHEM_LOCKED=§7Schematic gesperrt
@@ -59,7 +56,9 @@ STATE_RUNNING=§eKampfphase
STATE_SPECTATE_WIN=§7Sieg {0}
STATE_SPECTATE_TIE=§7Unentschieden
-REMOVE_TITLE=Spieler rauswerfen
+MANAGE_TITLE=Mitspieler verwalten
+MANAGE_LORE1=§eLinksklick§8: §eRauswurf
+MANAGE_LORE2=§eRechtsklick§8: §eBefördern
KIT_SELECTION_TITLE=Kitauswahl
KIT_NO_KITS=§cKeine Kits gefunden
@@ -106,7 +105,7 @@ SKIP_READY=§aBeschleunigung zum nächsten Event
SKIP_NOT_READY=§c§mBeschleunigung zum nächsten Event
CHOOSE_KIT=§eKit wählen
RESPAWN=§eRespawn
-REMOVE_PLAYERS=§cSpieler rauswerfen
+MANAGE_PLAYERS=§cMitspieler verwalten
CHOOSE_SCHEMATIC=§e{0} wählen
SCHEMATIC_REQUIRED=§cZuerst muss eine Schematic gewählt sein
ADD_AI=§eKI hinzufügen
@@ -134,7 +133,6 @@ NO_TELEPORT=§cDu darfst diese Teleportfunktion nicht benutzen
OPEN_INVENTORY_TO_CUSTOMIZE=§eInventar zum Anpassen des Kits öffnen
NO_ENTERN=§cDu darfst nicht entern
NO_TEAMAREA=§cDu darfst nicht zu den Teams
-TEST_BECOME_LEADER=§7Werde zum Teamleader mit §8/§eleader
PREPARE_SCHEM_DELETED=§cAnscheinend wurde die auszufahrende Schematic gelöscht, Einsenden wird abgebrochen.
PREPARE_SCHEM_EXISTS=§cEs existiert bereits eine Schem mit Namenszusatz -prepared, diese bitte umbenennen oder löschen, Einsenden wird abgebrochen.
PREPARE_ACTIVE_PISTON=§cIm Teambereich wurden sich noch bewegende Pistons gefunden, Einsenden wird abgebrochen.
diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/commands/GUI.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/commands/GUI.java
index 4834bb0a..2ca6849c 100644
--- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/commands/GUI.java
+++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/commands/GUI.java
@@ -36,6 +36,7 @@ import de.steamwar.sql.SteamwarUser;
import net.md_5.bungee.api.ChatMessageType;
import org.bukkit.Bukkit;
import org.bukkit.Material;
+import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -53,7 +54,11 @@ public class GUI {
String name = team.getLeader() != null ? team.getLeader().getEntity().getName() : team.getName();
inv.setItem(pos, SWItem.getDye(colorCode), colorCode, msg.parse("JOIN_REQUEST_TEAM", p, team.getColor() + name), click -> {
p.closeInventory();
- JoinRequest.forPlayer(p, team);
+
+ if(ArenaMode.ManualTeams.contains(Config.mode) && team.canbeLeader(p))
+ team.addMember(p);
+ else
+ JoinRequest.forPlayer(p, team);
});
}
@@ -117,14 +122,21 @@ public class GUI {
inv.open();
}
- public static void chooseRemove(Player p){
+ public static void managePlayers(Player p){
List> players = SWListInv.createPlayerList(p.getUniqueId());
FightTeam team = Fight.getPlayerTeam(p);
if(team == null)
return;
- players.removeIf(swItemUUIDPair -> !team.equals(Fight.getPlayerTeam(Bukkit.getPlayer(swItemUUIDPair.getObject()))));
- SWListInv inv = new SWListInv<>(p, msg.parse("REMOVE_TITLE", p), players, (ClickType click, UUID player) -> {
- Commands.kick(p, SteamwarUser.get(player).getUserName());
+ players.removeIf(listEntry -> !team.equals(Fight.getPlayerTeam(Bukkit.getPlayer(listEntry.getObject()))));
+ players.forEach(listEntry -> listEntry.getItem().setLore(msg.parse("MANAGE_LORE1", p), msg.parse("MANAGE_LORE2", p)));
+ SWListInv inv = new SWListInv<>(p, msg.parse("MANAGE_TITLE", p), players, (ClickType click, UUID player) -> {
+ if(click.isLeftClick()) {
+ Commands.kick(p, SteamwarUser.get(player).getUserName());
+ } else if(click.isRightClick()) {
+ LivingEntity target = (LivingEntity) Bukkit.getEntity(player);
+ if(target != null)
+ team.setLeader(team.getFightPlayer(target), false);
+ }
p.closeInventory();
});
inv.setCallback(-999, (ClickType click) -> p.closeInventory());
diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/commands/LeaderCommand.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/commands/LeaderCommand.java
deleted file mode 100644
index e2151956..00000000
--- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/commands/LeaderCommand.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- This file is a part of the SteamWar software.
-
- Copyright (C) 2020 SteamWar.de-Serverteam
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see .
-*/
-
-package de.steamwar.fightsystem.commands;
-
-import de.steamwar.fightsystem.ArenaMode;
-import de.steamwar.fightsystem.FightSystem;
-import de.steamwar.fightsystem.fight.Fight;
-import de.steamwar.fightsystem.fight.FightTeam;
-import de.steamwar.fightsystem.states.FightState;
-import de.steamwar.fightsystem.states.StateDependentCommand;
-import net.md_5.bungee.api.ChatMessageType;
-import org.bukkit.command.Command;
-import org.bukkit.command.CommandExecutor;
-import org.bukkit.command.CommandSender;
-import org.bukkit.entity.Player;
-
-public class LeaderCommand implements CommandExecutor {
-
- public LeaderCommand() {
- new StateDependentCommand(ArenaMode.ManualTeams, FightState.Setup, "leader", this);
- }
-
- @Override
- public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
- if(!(sender instanceof Player))
- return false;
- Player player = (Player) sender;
-
- if(Fight.getFightPlayer(player) != null) {
- FightSystem.getMessage().sendPrefixless("ALREADY_IN_TEAM", player, ChatMessageType.ACTION_BAR);
- return false;
- }
-
- for(FightTeam team : Fight.teams()) {
- if(team.canbeLeader(player)) {
- team.addMember(player);
- return false;
- }
- }
- FightSystem.getMessage().sendPrefixless("LEADER_FULL", player, ChatMessageType.ACTION_BAR);
- return false;
- }
-}
diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java
index 334f3f83..3a6a12a2 100644
--- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java
+++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java
@@ -73,7 +73,7 @@ public class FightTeam {
if(ArenaMode.VariableTeams.contains(Config.mode)){
notReadyKit.setItem(2, "REQUESTS", new ItemBuilder(Material.PAPER).build(), GUI::chooseJoinRequests);
- notReadyKit.setItem(3, "REMOVE_PLAYERS", new ItemBuilder(SWItem.getMaterial("FIREWORK_CHARGE")).build(), GUI::chooseRemove);
+ notReadyKit.setItem(3, "MANAGE_PLAYERS", SWItem.getPlayerSkull("AdmiralSeekrank").getItemStack(), GUI::managePlayers);
if(!AIManager.availableAIs().isEmpty())
notReadyKit.setItem(6, "ADD_AI", new ItemBuilder(Material.REDSTONE).build(), GUI::addAI);
}
@@ -343,7 +343,10 @@ public class FightTeam {
}
}
- private void setLeader(FightPlayer leader, boolean silent) {
+ public void setLeader(FightPlayer leader, boolean silent) {
+ if(this.leader != null)
+ this.leader.ifPlayer(memberKit::loadToPlayer);
+
leader.ifPlayer(PersonalKitCreator::closeIfInKitCreator);
this.leader = leader;
diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/TestJoin.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/TestJoin.java
index 77240153..13a512a4 100644
--- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/TestJoin.java
+++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/TestJoin.java
@@ -22,8 +22,6 @@ package de.steamwar.fightsystem.listener;
import de.steamwar.fightsystem.ArenaMode;
import de.steamwar.fightsystem.Config;
import de.steamwar.fightsystem.FightSystem;
-import de.steamwar.fightsystem.fight.Fight;
-import de.steamwar.fightsystem.fight.FightTeam;
import de.steamwar.fightsystem.states.FightState;
import de.steamwar.fightsystem.states.StateDependentListener;
import de.steamwar.sql.SteamwarUser;
@@ -42,7 +40,6 @@ public class TestJoin implements Listener {
@EventHandler
public void handlePlayerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
- FightTeam fightTeam = Fight.getPlayerTeam(player);
if(Config.ReplayID != 0 && !SteamwarUser.get(player.getUniqueId()).hasPerm(UserPerm.MODERATION)) {
FightSystem.getMessage().send("CHECK_JOIN_DENIED", player);
@@ -50,10 +47,6 @@ public class TestJoin implements Listener {
return;
}
- if (fightTeam == null && Fight.teams().stream().anyMatch(team -> team.canbeLeader(player))) {
- FightSystem.getMessage().send("TEST_BECOME_LEADER", player);
- }
-
player.setOp(true);
if(FightState.getFightState() == FightState.PRE_LEADER_SETUP){
diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/record/PacketProcessor.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/record/PacketProcessor.java
index 825c5eb6..47efc09d 100644
--- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/record/PacketProcessor.java
+++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/record/PacketProcessor.java
@@ -22,6 +22,7 @@ package de.steamwar.fightsystem.record;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import de.steamwar.core.Core;
import de.steamwar.core.TrickyTrialsWrapper;
+import de.steamwar.core.WorldEditWrapper;
import de.steamwar.entity.REntity;
import de.steamwar.entity.REntityServer;
import de.steamwar.entity.RPlayer;
@@ -523,7 +524,7 @@ public class PacketProcessor implements Listener {
public void close() {
// FAWE 1.12 calls close...
}
- }, Core.getVersion() > 12);
+ }, WorldEditWrapper.impl.getNativeFormat());
execSync(() -> team.pasteSchem(schemId, clipboard));
}
diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/BungeeFightInfo.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/BungeeFightInfo.java
index 6ffa0e98..783917bb 100644
--- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/BungeeFightInfo.java
+++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/BungeeFightInfo.java
@@ -40,10 +40,6 @@ public class BungeeFightInfo {
}
private void send() {
- Player player = Bukkit.getOnlinePlayers().stream().findAny().orElse(null);
- if(player == null)
- return;
-
NetworkSender.send(new FightInfoPacket(
Config.world.getName(),
Config.SchematicType.toDB(),
diff --git a/FightSystem/FightSystem_Core/src/plugin.yml b/FightSystem/FightSystem_Core/src/plugin.yml
index d8763954..64ece716 100644
--- a/FightSystem/FightSystem_Core/src/plugin.yml
+++ b/FightSystem/FightSystem_Core/src/plugin.yml
@@ -19,7 +19,6 @@ commands:
ready:
kit:
remove:
- leader:
lockschem:
state:
skip:
diff --git a/LobbySystem/src/de/steamwar/lobby/LobbySystem.properties b/LobbySystem/src/de/steamwar/lobby/LobbySystem.properties
index 2d3aa782..275a99a8 100644
--- a/LobbySystem/src/de/steamwar/lobby/LobbySystem.properties
+++ b/LobbySystem/src/de/steamwar/lobby/LobbySystem.properties
@@ -10,6 +10,13 @@ NPC_CHAT_2 = §eSteam§8War§f was established in 2019.
NPC_CHAT_3 = §fBecome a part of our team by applying via our Discord server (https://steamwar.de/discord).
NPC_CHAT_4 = §fYou can develop your own buildserver features with our Lua script system.
NPC_CHAT_5 = §fThere are many secrets to discover in this lobby.
+## TheBreadBeard
+NPC_CHAT_3266_0 = §fI collect Alts like Infinity Stones.
+NPC_CHAT_3266_1 = &fYou want my Bread? You can have it! Just look for it! I've hidden the best bakery in the world somewhere!
+NPC_CHAT_3266_2 = &fHey, I am TheBreadBeard, ex- EuropSuchties Player, formerly (un)known as WarGear_Titan.
+NPC_CHAT_3266_3 = &fInventor of Lactose Intolerance, the Placeholder and Infinity-Ring. All technical principles no one knows or needs.
+NPC_CHAT_3266_4 = &fKnown for the Lobby-Banners, logos, spontaneous Arenas, as well as an Organizer and Moderator of many Events.
+NPC_CHAT_3266_5 = &fFrom Supporter to Moderator to Builder ... Maybe the journey takes me to being a Developer next.
# Portal Command
PORTAL_COMMAND_LIST_HELP = §8/§7portal §elist §8- §7Lists all portals
diff --git a/LobbySystem/src/de/steamwar/lobby/LobbySystem_de.properties b/LobbySystem/src/de/steamwar/lobby/LobbySystem_de.properties
index 73808174..bf382639 100644
--- a/LobbySystem/src/de/steamwar/lobby/LobbySystem_de.properties
+++ b/LobbySystem/src/de/steamwar/lobby/LobbySystem_de.properties
@@ -10,6 +10,13 @@ NPC_CHAT_2 = §eSteam§8War§f gibt es seit 2019.
NPC_CHAT_3 = §fBewerbe dich gerne für unser Team über unseren Discord-Server (https://steamwar.de/discord).
NPC_CHAT_4 = §fDu kannst mit unserm Lua Script-System deine eigenen Bau Features programmieren.
NPC_CHAT_5 = §fAuf dieser Lobby sind so einige secrets versteckt.
+## TheBreadBeard
+NPC_CHAT_3266_0 = §fIch sammel Alts wie Infinity Stones.
+NPC_CHAT_3266_1 = &fIhr wollt meine Teigwaren? Die könnt ihr haben! Sucht sie doch! Irgendwo hab ich die beste Bäckerei der Welt versteckt!
+NPC_CHAT_3266_2 = &fMoin, Ich bin TheBreadBeard, ehemaliger EuropSuchties Spieler, damals (un)bekannt als WarGear_Titan.
+NPC_CHAT_3266_3 = &fErfinder der Laktoseintoleranz, des Platzhalters und des Infinity-Rings. Alles Prinzipien, die keiner kennt und keiner braucht.
+NPC_CHAT_3266_4 = &fBekannt für die Lobbybanner, Logos, spontane Arenen, sowie als Leiter von so manchem Event.
+NPC_CHAT_3266_5 = &fVon Supporter zu Moderator zu Builder ... Vielleicht führt mich die Reise als Nächstes zum Developer.
# Portal Command
PORTAL_COMMAND_LIST_HELP = §8/§7portal §elist §8- §7Listet alle Portale auf
diff --git a/LobbySystem/src/de/steamwar/lobby/team/TeamPlayer.java b/LobbySystem/src/de/steamwar/lobby/team/TeamPlayer.java
index 2829ec2f..989fca7a 100644
--- a/LobbySystem/src/de/steamwar/lobby/team/TeamPlayer.java
+++ b/LobbySystem/src/de/steamwar/lobby/team/TeamPlayer.java
@@ -23,7 +23,6 @@ import de.steamwar.lobby.LobbySystem;
import de.steamwar.lobby.display.NPC;
import de.steamwar.lobby.listener.BasicListener;
import de.steamwar.sql.SteamwarUser;
-import de.steamwar.sql.UserPerm;
import lombok.AllArgsConstructor;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@@ -135,6 +134,10 @@ public class TeamPlayer extends BasicListener {
return false;
}
+ private String parseRandomMessage(Player player, SteamwarUser target, String message) throws MissingResourceException {
+ return LobbySystem.getMessage().parsePrefixed(message + random.nextInt(6), player, target.getUserName(), target.prefix().getColorCode() + target.prefix().getChatPrefix());
+ }
+
@EventHandler
public void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
if (!(event.getRightClicked() instanceof Villager)) {
@@ -145,10 +148,14 @@ public class TeamPlayer extends BasicListener {
return;
}
- String message = "NPC_CHAT_" + random.nextInt(6);
- SteamwarUser user = SteamwarUser.get(event.getRightClicked().getName());
- UserPerm.Prefix prefix = user.prefix();
- LobbySystem.getMessage().send(message, event.getPlayer(), event.getRightClicked().getName(), prefix.getColorCode() + prefix.getChatPrefix());
+ SteamwarUser target = SteamwarUser.get(event.getRightClicked().getName());
+ String message;
+ try {
+ message = parseRandomMessage(event.getPlayer(), target, "NPC_CHAT_" + target.getId() + "_");
+ } catch (MissingResourceException e) {
+ message = parseRandomMessage(event.getPlayer(), target, "NPC_CHAT_");
+ }
+ event.getPlayer().sendMessage(message);
}
@EventHandler
diff --git a/SchematicSystem/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/schematiccommand/SchematicCommandUtils.java b/SchematicSystem/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/schematiccommand/SchematicCommandUtils.java
index 2b953b74..860435b9 100644
--- a/SchematicSystem/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/schematiccommand/SchematicCommandUtils.java
+++ b/SchematicSystem/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/schematiccommand/SchematicCommandUtils.java
@@ -245,7 +245,7 @@ public class SchematicCommandUtils {
SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_ELO", player, node.getElo(Season.getSeason()));
}
- SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_FORMAT", player, node.getSchemFormat() ? ".schem" : ".schematic");
+ SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_FORMAT", player, node.getFileEnding());
CheckedSchematic.getLastDeclinedOfNode(node.getId()).stream().findFirst().ifPresent(checkedSchematic -> SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_STATUS", player, checkedSchematic.getEndTime(), checkedSchematic.getDeclineReason()));
} else {
SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_TYPE", player, SchematicSystem.MESSAGE.parse("UTIL_INFO_TYPE_DIR", player));
diff --git a/SpigotCore/SpigotCore_14/src/de/steamwar/core/WorldEditWrapper14.java b/SpigotCore/SpigotCore_14/src/de/steamwar/core/WorldEditWrapper14.java
index cd116bac..3251e5bc 100644
--- a/SpigotCore/SpigotCore_14/src/de/steamwar/core/WorldEditWrapper14.java
+++ b/SpigotCore/SpigotCore_14/src/de/steamwar/core/WorldEditWrapper14.java
@@ -22,7 +22,6 @@ package de.steamwar.core;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Maps;
import com.sk89q.jnbt.*;
-import com.sk89q.worldedit.EmptyClipboardException;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extension.input.InputParseException;
@@ -45,36 +44,30 @@ import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.registry.LegacyMapper;
import de.steamwar.sql.NoClipboardException;
+import de.steamwar.sql.NodeData;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import java.io.*;
import java.util.*;
-import java.util.logging.Level;
import java.util.stream.Collectors;
import static com.google.common.base.Preconditions.checkNotNull;
+@SuppressWarnings("removal")
public class WorldEditWrapper14 implements WorldEditWrapper {
- private static final ClipboardFormat SCHEMATIC = BuiltInClipboardFormat.MCEDIT_SCHEMATIC;
- private static final ClipboardFormat SCHEM = BuiltInClipboardFormat.SPONGE_SCHEMATIC;
-
@Override
- public InputStream getPlayerClipboard(Player player, boolean schemFormat) {
- return WorldEditWrapper.getPlayerClipboard(player, schemFormat, (outputStream, clipboard, clipboardHolder) -> {
- if(schemFormat){
- ClipboardWriter writer = SCHEM.getWriter(outputStream);
- writer.write(clipboard);
- writer.close();
- }else{
- SCHEMATIC.getWriter(outputStream).write(clipboard);
- }
+ public InputStream getPlayerClipboard(Player player) {
+ return WorldEditWrapper.getPlayerClipboard(player, (outputStream, clipboard, clipboardHolder) -> {
+ ClipboardWriter writer = BuiltInClipboardFormat.SPONGE_SCHEMATIC.getWriter(outputStream);
+ writer.write(clipboard);
+ writer.close();
});
}
@Override
- public void setPlayerClipboard(Player player, InputStream is, boolean schemFormat) {
+ public void setPlayerClipboard(Player player, InputStream is, NodeData.SchematicFormat schemFormat) {
Clipboard clipboard = null;
try {
clipboard = getClipboard(is, schemFormat);
@@ -90,12 +83,17 @@ public class WorldEditWrapper14 implements WorldEditWrapper {
}
@Override
- public Clipboard getClipboard(InputStream is, boolean schemFormat) throws IOException {
+ public Clipboard getClipboard(InputStream is, NodeData.SchematicFormat schemFormat) throws IOException {
try {
- if(schemFormat){
- return new SpongeSchematicReader(new NBTInputStream(is)).read();
- }else{
- return new MCEditSchematicReader(new NBTInputStream(is)).read();
+
+ switch (schemFormat) {
+ case SPONGE_V2:
+ case SPONGE_V3:
+ return new SpongeSchematicReader(new NBTInputStream(is), this).read();
+ case MCEDIT:
+ return new MCEditSchematicReader(new NBTInputStream(is)).read();
+ default:
+ throw new IOException("This schematic format is currently not supported");
}
} catch (NullPointerException e) {
throw new NoClipboardException();
@@ -124,6 +122,15 @@ public class WorldEditWrapper14 implements WorldEditWrapper {
return new org.bukkit.util.Vector(v.getX(), v.getY(), v.getZ());
}
+ @Override
+ public NodeData.SchematicFormat getNativeFormat() {
+ return NodeData.SchematicFormat.SPONGE_V2;
+ }
+
+ public Map applyDataFixer(DataFixer fixer, int dataVersion, Map values) {
+ return fixer.fixUp(DataFixer.FixTypes.BLOCK_ENTITY, new CompoundTag(values), dataVersion).getValue();
+ }
+
private static class MCEditSchematicReader extends NBTSchematicReader {
private final NBTInputStream inputStream;
@@ -387,22 +394,24 @@ public class WorldEditWrapper14 implements WorldEditWrapper {
inputStream.close();
}
}
- private static class SpongeSchematicReader extends NBTSchematicReader {
+ public static class SpongeSchematicReader extends NBTSchematicReader {
private final NBTInputStream inputStream;
private DataFixer fixer = null;
private int schematicVersion = -1;
private int dataVersion = -1;
private boolean faweSchem = false;
+ private final WorldEditWrapper14 wrapper;
/**
* Create a new instance.
*
* @param inputStream the input stream to read from
*/
- public SpongeSchematicReader(NBTInputStream inputStream) {
+ public SpongeSchematicReader(NBTInputStream inputStream, WorldEditWrapper14 wrapper) {
checkNotNull(inputStream);
this.inputStream = inputStream;
+ this.wrapper = wrapper;
}
@Override
@@ -418,7 +427,7 @@ public class WorldEditWrapper14 implements WorldEditWrapper {
dataVersion = 1631; // this is a relatively safe assumption unless someone imports a schematic from 1.12, e.g. sponge 7.1-
fixer = platform.getDataFixer();
return readVersion1(schematicTag);
- } else if (schematicVersion == 2) {
+ } else if (schematicVersion == 2 || schematicVersion == 3) {
dataVersion = requireTag(schematic, "DataVersion", IntTag.class).getValue();
if (dataVersion < liveDataVersion) {
fixer = platform.getDataFixer();
@@ -447,14 +456,18 @@ public class WorldEditWrapper14 implements WorldEditWrapper {
private CompoundTag getBaseTag() throws IOException {
NamedTag rootTag = inputStream.readNamedTag();
- if (!rootTag.getName().equals("Schematic")) {
- throw new IOException("Tag 'Schematic' does not exist or is not first");
- }
CompoundTag schematicTag = (CompoundTag) rootTag.getTag();
// Check
Map schematic = schematicTag.getValue();
+ if (schematic.size() == 1) {
+ schematicTag = requireTag(schematic, "Schematic", CompoundTag.class);
+ schematic = schematicTag.getValue();
+ } else if (!rootTag.getName().equals("Schematic")) {
+ throw new IOException("Tag 'Schematic' does not exist or is not first");
+ }
+
schematicVersion = requireTag(schematic, "Version", IntTag.class).getValue();
return schematicTag;
}
@@ -499,12 +512,16 @@ public class WorldEditWrapper14 implements WorldEditWrapper {
region = new CuboidRegion(origin, origin.add(width, height, length).subtract(BlockVector3.ONE));
}
- IntTag paletteMaxTag = getTag(schematic, "PaletteMax", IntTag.class);
- Map paletteObject = requireTag(schematic, "Palette", CompoundTag.class).getValue();
- if (paletteMaxTag != null && paletteObject.size() != paletteMaxTag.getValue()) {
- throw new IOException("Block palette size does not match expected size.");
+ Map blockContainer = null;
+ boolean v3Mode = false;
+
+ if (schematicVersion == 3) {
+ blockContainer = requireTag(schematic, "Blocks", CompoundTag.class).getValue();
+ v3Mode = true;
}
+ Map paletteObject = requireTag(v3Mode ? blockContainer: schematic, "Palette", CompoundTag.class).getValue();
+
Map palette = new HashMap<>();
ParserContext parserContext = new ParserContext();
@@ -526,12 +543,12 @@ public class WorldEditWrapper14 implements WorldEditWrapper {
palette.put(id, state);
}
- byte[] blocks = requireTag(schematic, "BlockData", ByteArrayTag.class).getValue();
+ byte[] blocks = requireTag(v3Mode ? blockContainer: schematic, v3Mode ? "Data" : "BlockData", ByteArrayTag.class).getValue();
Map> tileEntitiesMap = new HashMap<>();
- ListTag tileEntities = getTag(schematic, "BlockEntities", ListTag.class);
+ ListTag tileEntities = getTag(v3Mode ? blockContainer: schematic, "BlockEntities", ListTag.class);
if (tileEntities == null) {
- tileEntities = getTag(schematic, "TileEntities", ListTag.class);
+ tileEntities = getTag(v3Mode ? blockContainer: schematic, "TileEntities", ListTag.class);
}
if (tileEntities != null) {
List