forked from SteamWar/SteamWar
Compare commits
14
Commits
main
...
version/legacy
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
917a1b1c7c | ||
|
|
cab5ab8cc8 | ||
|
|
a98c10813d | ||
|
|
1ef562ea43 | ||
|
|
d1c8c7ef2e | ||
|
|
f8fbe4c39b | ||
|
|
fbdf2c888f | ||
|
|
564a1ceaab | ||
|
|
fa6e6d3dc9 | ||
|
|
c146391646 | ||
|
|
32611fd1d6 | ||
|
|
56fd93a474
|
||
|
|
c27789daa8 | ||
|
|
56a7344d67 |
@@ -63,9 +63,6 @@ jobs:
|
|||||||
cp "SpigotCore/build/libs/SpigotCore-all.jar" "deploy/SpigotCore.jar"
|
cp "SpigotCore/build/libs/SpigotCore-all.jar" "deploy/SpigotCore.jar"
|
||||||
cp "Teamserver/build/libs/Teamserver.jar" "deploy/Builder.jar"
|
cp "Teamserver/build/libs/Teamserver.jar" "deploy/Builder.jar"
|
||||||
cp "TowerRun/build/libs/TowerRun.jar" "deploy/TowerRun.jar"
|
cp "TowerRun/build/libs/TowerRun.jar" "deploy/TowerRun.jar"
|
||||||
cp "VelocityCore/Persistent/build/libs/Persistent.jar" "deploy/PersistentVelocityCore.jar"
|
|
||||||
cp "VelocityCore/Dependencies/build/libs/Dependencies-all.jar" "deploy/DependenciesVelocityCore.jar"
|
|
||||||
cp "VelocityCore/build/libs/VelocityCore-all.jar" "deploy/VelocityCore.jar"
|
|
||||||
cp "WebsiteBackend/build/libs/WebsiteBackend-all.jar" "deploy/website-api.jar"
|
cp "WebsiteBackend/build/libs/WebsiteBackend-all.jar" "deploy/website-api.jar"
|
||||||
cp "CLI/build/distributions/sw.zip" "deploy/sw.zip"
|
cp "CLI/build/distributions/sw.zip" "deploy/sw.zip"
|
||||||
|
|
||||||
@@ -130,7 +127,12 @@ jobs:
|
|||||||
ssh-keyscan -p "$port" "$DEPLOY_HOST" >> ~/.ssh/known_hosts
|
ssh-keyscan -p "$port" "$DEPLOY_HOST" >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
ssh -i ~/.ssh/deploy_key -p "$port" "${DEPLOY_USER}@${DEPLOY_HOST}" "mkdir -p '$DEPLOY_PATH'"
|
ssh -i ~/.ssh/deploy_key -p "$port" "${DEPLOY_USER}@${DEPLOY_HOST}" "mkdir -p '$DEPLOY_PATH'"
|
||||||
scp -i ~/.ssh/deploy_key -P "$port" deploy/* "${DEPLOY_USER}@${DEPLOY_HOST}:$DEPLOY_PATH/"
|
ssh -i ~/.ssh/deploy_key -p "$port" "${DEPLOY_USER}@${DEPLOY_HOST}" "mkdir -p '$DEPLOY_PATH/upload'"
|
||||||
|
scp -i ~/.ssh/deploy_key -P "$port" deploy/* "${DEPLOY_USER}@${DEPLOY_HOST}:$DEPLOY_PATH/upload"
|
||||||
|
ssh -i ~/.ssh/deploy_key -p "$port" "${DEPLOY_USER}@${DEPLOY_HOST}" "rm -f '$DEPLOY_PATH'/*.jar '$DEPLOY_PATH'/*.zip"
|
||||||
|
ssh -i ~/.ssh/deploy_key -p "$port" "${DEPLOY_USER}@${DEPLOY_HOST}" "mv '$DEPLOY_PATH'/upload/* '$DEPLOY_PATH'"
|
||||||
|
ssh -i ~/.ssh/deploy_key -p "$port" "${DEPLOY_USER}@${DEPLOY_HOST}" "rm -r '$DEPLOY_PATH/upload'"
|
||||||
|
ssh -i ~/.ssh/deploy_key -p "$port" "${DEPLOY_USER}@${DEPLOY_HOST}" "chmod o-w '$DEPLOY_PATH'/*"
|
||||||
- name: Restart Services
|
- name: Restart Services
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -864,6 +864,7 @@ LAUFBAU_SETTINGS_ADVANCED=§eLeft-Click §8-§7 Advanced settings
|
|||||||
LAUFBAU_BLOCK_COBWEB=§eCobweb
|
LAUFBAU_BLOCK_COBWEB=§eCobweb
|
||||||
LAUFBAU_BLOCK_GRASS_PATH=§eGrass Path
|
LAUFBAU_BLOCK_GRASS_PATH=§eGrass Path
|
||||||
LAUFBAU_BLOCK_SOUL_SAND=§eSoul Sand
|
LAUFBAU_BLOCK_SOUL_SAND=§eSoul Sand
|
||||||
|
LAUFBAU_BLOCK_MUD=§eMud
|
||||||
LAUFBAU_BLOCK_COCOA=§eCocoa
|
LAUFBAU_BLOCK_COCOA=§eCocoa
|
||||||
LAUFBAU_BLOCK_TURTLE_EGG=§eTurtle Eggs
|
LAUFBAU_BLOCK_TURTLE_EGG=§eTurtle Eggs
|
||||||
LAUFBAU_BLOCK_CHEST=§eChest
|
LAUFBAU_BLOCK_CHEST=§eChest
|
||||||
|
|||||||
@@ -802,6 +802,7 @@ LAUFBAU_SETTINGS_ADVANCED=§eLinks-Click §8-§7 Erweiterte Einstellung
|
|||||||
LAUFBAU_BLOCK_COBWEB=§eCobweb
|
LAUFBAU_BLOCK_COBWEB=§eCobweb
|
||||||
LAUFBAU_BLOCK_GRASS_PATH=§eGrass Path
|
LAUFBAU_BLOCK_GRASS_PATH=§eGrass Path
|
||||||
LAUFBAU_BLOCK_SOUL_SAND=§eSoul Sand
|
LAUFBAU_BLOCK_SOUL_SAND=§eSoul Sand
|
||||||
|
LAUFBAU_BLOCK_MUD=§eMud
|
||||||
LAUFBAU_BLOCK_COCOA=§eCocoa
|
LAUFBAU_BLOCK_COCOA=§eCocoa
|
||||||
LAUFBAU_BLOCK_TURTLE_EGG=§eTurtle Eggs
|
LAUFBAU_BLOCK_TURTLE_EGG=§eTurtle Eggs
|
||||||
LAUFBAU_BLOCK_CHEST=§eChest
|
LAUFBAU_BLOCK_CHEST=§eChest
|
||||||
|
|||||||
+5
-1
@@ -101,7 +101,11 @@ public class BlockBoundingBox {
|
|||||||
addPixel(Material.END_STONE.createBlockData(), 0, 0, 0, 16, 16, 16, null);
|
addPixel(Material.END_STONE.createBlockData(), 0, 0, 0, 16, 16, 16, null);
|
||||||
|
|
||||||
addPixel(NMSWrapper.impl.pathMaterial().createBlockData(), 0, 0, 0, 16, 15, 16, createItem("LAUFBAU_BLOCK_GRASS_PATH", NMSWrapper.impl.pathMaterial()));
|
addPixel(NMSWrapper.impl.pathMaterial().createBlockData(), 0, 0, 0, 16, 15, 16, createItem("LAUFBAU_BLOCK_GRASS_PATH", NMSWrapper.impl.pathMaterial()));
|
||||||
addPixel(Material.MUD.createBlockData(), 0, 0, 0, 16, 14, 16, createItem("LAUFBAU_BLOCK_SOUL_SAND", Material.SOUL_SAND));
|
addPixel(Material.SOUL_SAND.createBlockData(), 0, 0, 0, 16, 14, 16, createItem("LAUFBAU_BLOCK_SOUL_SAND", Material.SOUL_SAND));
|
||||||
|
|
||||||
|
if (Core.getVersion() >= 19) {
|
||||||
|
addPixel(Material.MUD.createBlockData(), 0, 0, 0, 16, 14, 16, createItem("LAUFBAU_BLOCK_MUD", Material.MUD));
|
||||||
|
}
|
||||||
|
|
||||||
Cocoa cocoaNorth = (Cocoa) Material.COCOA.createBlockData();
|
Cocoa cocoaNorth = (Cocoa) Material.COCOA.createBlockData();
|
||||||
cocoaNorth.setAge(2);
|
cocoaNorth.setAge(2);
|
||||||
|
|||||||
-2
@@ -25,14 +25,12 @@ import de.steamwar.bausystem.shared.Pair;
|
|||||||
import de.steamwar.bausystem.utils.WorldEditUtils;
|
import de.steamwar.bausystem.utils.WorldEditUtils;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import de.steamwar.linkage.Linked;
|
import de.steamwar.linkage.Linked;
|
||||||
import de.steamwar.linkage.MinVersion;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
@Linked
|
@Linked
|
||||||
@MinVersion(19)
|
|
||||||
public class LaufbauCommand extends SWCommand {
|
public class LaufbauCommand extends SWCommand {
|
||||||
|
|
||||||
public LaufbauCommand() {
|
public LaufbauCommand() {
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2026 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 <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package de.steamwar.network.packets.server;
|
||||||
|
|
||||||
|
import de.steamwar.network.packets.NetworkPacket;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A chat message written on an arena. The arena only records it for the replay and never displays it.
|
||||||
|
*/
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Getter
|
||||||
|
public class ChatRecordPacket extends NetworkPacket {
|
||||||
|
private static final long serialVersionUID = -4718360932583127458L;
|
||||||
|
private int playerId;
|
||||||
|
private String message;
|
||||||
|
}
|
||||||
@@ -30,6 +30,7 @@ import java.time.LocalDateTime;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@ToString
|
@ToString
|
||||||
public final class GameModeConfig<M, W> {
|
public final class GameModeConfig<M, W> {
|
||||||
@@ -710,13 +711,26 @@ public final class GameModeConfig<M, W> {
|
|||||||
Map<Set<M>, Integer> Limited = new HashMap<>();
|
Map<Set<M>, Integer> Limited = new HashMap<>();
|
||||||
for (Map<?, ?> entry : loader.getMapList("Limited")) {
|
for (Map<?, ?> entry : loader.getMapList("Limited")) {
|
||||||
int amount = (Integer) entry.get("Amount");
|
int amount = (Integer) entry.get("Amount");
|
||||||
Set<String> materials = new HashSet<>((List<String>) entry.get("Materials"));
|
Set<M> materials = Stream.of((List<String>) entry.get("Materials"))
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.flatMap(List::stream)
|
||||||
|
.map(String::toUpperCase)
|
||||||
|
.map(material -> {
|
||||||
|
try {
|
||||||
|
return loader.materialMapper.apply(material);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
if (amount == 0) {
|
if (amount == 0) {
|
||||||
materials.forEach(material -> {
|
materials.forEach(material -> {
|
||||||
Limited.put(Collections.singleton(loader.materialMapper.apply(material.toUpperCase())), 0);
|
Limited.put(Collections.singleton(material), 0);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Limited.put(Collections.unmodifiableSet(materials.stream().map(String::toUpperCase).map(loader.materialMapper).collect(Collectors.toSet())), amount);
|
Limited.put(materials, amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SQLWrapper.impl.getMaterialWithGreaterBlastResistance(MaxBlastResistance).forEach(material -> {
|
SQLWrapper.impl.getMaterialWithGreaterBlastResistance(MaxBlastResistance).forEach(material -> {
|
||||||
|
|||||||
@@ -243,10 +243,6 @@ public class FightTeam {
|
|||||||
broadcast(player -> FightSystem.getMessage().send(message, player, params));
|
broadcast(player -> FightSystem.getMessage().send(message, player, params));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void broadcastChat(Player sender, String message) {
|
|
||||||
broadcast(player -> FightSystem.getMessage().sendPrefixless("TEAM_CHAT", player, ChatMessageType.CHAT, prefix, sender.getName(), message));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void broadcast(Consumer<Player> f) {
|
private void broadcast(Consumer<Player> f) {
|
||||||
players.forEach((uuid, fightPlayer) -> {
|
players.forEach((uuid, fightPlayer) -> {
|
||||||
Player player = Bukkit.getPlayer(uuid);
|
Player player = Bukkit.getPlayer(uuid);
|
||||||
|
|||||||
@@ -19,50 +19,41 @@
|
|||||||
|
|
||||||
package de.steamwar.fightsystem.listener;
|
package de.steamwar.fightsystem.listener;
|
||||||
|
|
||||||
import de.steamwar.fightsystem.ArenaMode;
|
|
||||||
import de.steamwar.fightsystem.Config;
|
import de.steamwar.fightsystem.Config;
|
||||||
import de.steamwar.fightsystem.FightSystem;
|
import de.steamwar.fightsystem.FightSystem;
|
||||||
import de.steamwar.fightsystem.fight.Fight;
|
import de.steamwar.fightsystem.fight.Fight;
|
||||||
import de.steamwar.fightsystem.fight.FightTeam;
|
import de.steamwar.fightsystem.fight.FightTeam;
|
||||||
import de.steamwar.fightsystem.record.GlobalRecorder;
|
import de.steamwar.fightsystem.record.GlobalRecorder;
|
||||||
import de.steamwar.fightsystem.states.FightState;
|
|
||||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
|
||||||
import de.steamwar.linkage.Linked;
|
import de.steamwar.linkage.Linked;
|
||||||
|
import de.steamwar.network.packets.PacketHandler;
|
||||||
|
import de.steamwar.network.packets.server.ChatRecordPacket;
|
||||||
|
import de.steamwar.sql.SteamwarUser;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Chat is handled by Velocity. Messages written on this server are only sent here to be recorded for the replay.
|
||||||
|
*/
|
||||||
@Linked
|
@Linked
|
||||||
public class Chat implements Listener {
|
public class Chat extends PacketHandler {
|
||||||
|
|
||||||
public Chat(){
|
@Handler
|
||||||
new StateDependentListener(ArenaMode.All, FightState.All, this);
|
public void handleChatRecord(ChatRecordPacket packet) {
|
||||||
}
|
SteamwarUser user = SteamwarUser.byId(packet.getPlayerId());
|
||||||
|
String message = packet.getMessage();
|
||||||
|
FightSystem.getPlugin().getLogger().log(Level.INFO, user.getUserName() + "» " + message);
|
||||||
|
|
||||||
@EventHandler
|
Player player = Bukkit.getPlayer(user.getUUID());
|
||||||
public void handlePlayerChat(AsyncPlayerChatEvent event) {
|
FightTeam fightTeam = player != null ? Fight.getPlayerTeam(player) : null;
|
||||||
Player player = event.getPlayer();
|
if (fightTeam != null) {
|
||||||
String message = event.getMessage();
|
GlobalRecorder.getInstance().chat("PARTICIPANT_CHAT", fightTeam.getColoredName(), user.getUserName(), message);
|
||||||
|
} else if (player != null && Config.isReferee(player)) {
|
||||||
FightSystem.getPlugin().getLogger().log(Level.INFO, player.getName() + "» " + message);
|
GlobalRecorder.getInstance().chat("FIGHTLEADER_CHAT", user.getUserName(), message);
|
||||||
FightTeam fightTeam = Fight.getPlayerTeam(player);
|
} else {
|
||||||
if(fightTeam != null) {
|
GlobalRecorder.getInstance().chat("SPECTATOR_CHAT", user.getUserName(), message);
|
||||||
String teamName = fightTeam.getColoredName();
|
|
||||||
if(message.startsWith(Config.GameModeConfig.TeamChatPrefix)) {
|
|
||||||
fightTeam.broadcastChat(player, message.substring(1));
|
|
||||||
} else {
|
|
||||||
broadcastChat("PARTICIPANT_CHAT", teamName, player.getName(), message);
|
|
||||||
}
|
|
||||||
}else if(Config.isReferee(player)){
|
|
||||||
broadcastChat("FIGHTLEADER_CHAT", player.getName(), message);
|
|
||||||
}else{
|
|
||||||
broadcastChat("SPECTATOR_CHAT", player.getName(), message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void broadcastChat(String message, Object... params) {
|
public static void broadcastChat(String message, Object... params) {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class REntity {
|
|||||||
|
|
||||||
private static final Object entityStatusWatcher = BountifulWrapper.impl.getDataWatcherObject(0, Byte.class);
|
private static final Object entityStatusWatcher = BountifulWrapper.impl.getDataWatcherObject(0, Byte.class);
|
||||||
private static final Object sneakingDataWatcher = BountifulWrapper.impl.getDataWatcherObject(Core.getVersion() > 12 ? 6 : 0, FlatteningWrapper.impl.getPose(FlatteningWrapper.EntityPose.NORMAL).getClass());
|
private static final Object sneakingDataWatcher = BountifulWrapper.impl.getDataWatcherObject(Core.getVersion() > 12 ? 6 : 0, FlatteningWrapper.impl.getPose(FlatteningWrapper.EntityPose.NORMAL).getClass());
|
||||||
private static final Object bowDrawnWatcher = Core.getVersion() >= 21 ? BountifulWrapper.impl.getDataWatcherObject(6, FlatteningWrapper.impl.getPose(FlatteningWrapper.EntityPose.NORMAL).getClass()) : BountifulWrapper.impl.getDataWatcherObject(Core.getVersion() > 12 ? 7 : 6, Byte.class);
|
private static final Object bowDrawnWatcher = Core.getVersion() >= 21 ? BountifulWrapper.impl.getDataWatcherObject(6, FlatteningWrapper.impl.getPose(FlatteningWrapper.EntityPose.NORMAL).getClass()) : BountifulWrapper.impl.getDataWatcherObject(Core.getVersion() >= 17 ? 8 : (Core.getVersion() > 12 ? 7 : 6), Byte.class);
|
||||||
private static final Object nameWatcher = BountifulWrapper.impl.getDataWatcherObject(2, Core.getVersion() > 12 ? Optional.class : String.class); // Optional<IChatBaseComponent>
|
private static final Object nameWatcher = BountifulWrapper.impl.getDataWatcherObject(2, Core.getVersion() > 12 ? Optional.class : String.class); // Optional<IChatBaseComponent>
|
||||||
private static final Object nameVisibleWatcher = BountifulWrapper.impl.getDataWatcherObject(3, Boolean.class);
|
private static final Object nameVisibleWatcher = BountifulWrapper.impl.getDataWatcherObject(3, Boolean.class);
|
||||||
|
|
||||||
|
|||||||
@@ -251,11 +251,5 @@ include("TowerRun")
|
|||||||
|
|
||||||
include("TutorialSystem")
|
include("TutorialSystem")
|
||||||
|
|
||||||
include(
|
|
||||||
"VelocityCore",
|
|
||||||
"VelocityCore:Dependencies",
|
|
||||||
"VelocityCore:Persistent"
|
|
||||||
)
|
|
||||||
|
|
||||||
include("TNTLeague")
|
include("TNTLeague")
|
||||||
include("WebsiteBackend")
|
include("WebsiteBackend")
|
||||||
|
|||||||
Reference in New Issue
Block a user