Merge branch 'main' into update/1.21.5

# Conflicts:
#	VelocityCore/src/de/steamwar/velocitycore/ServerVersion.java
This commit is contained in:
2025-05-31 20:20:07 +02:00
38 changed files with 550 additions and 138 deletions
@@ -35,7 +35,7 @@ public abstract class Node {
private static final List<String> OPENJ9_ARGS = Arrays.asList(
"-XX:+EnableCRIUSupport", "-XX:-CRIURestoreNonPortableMode",
"-Xgc:excessiveGCratio=80", "-Xdisableexplicitgc", "-Xnoclassgc", "-Xmos128M", "-Xmns48M", "-XX:+ExitOnOutOfMemoryError", // initial heap half values of memory observed by 1.19 spectate server
"-Xsyslog:none", "-Xtrace:none", "-Xverify:none", "-Xdump:system:none", "-Xdump:jit:none", "-Xdump:snap:none",
"-Xsyslog:none", "-Xtrace:none", "-Xverify:none", "-Xdump:system:none", "-Xdump:jit:none", "-Xdump:snap:none", "-Xdump:heap:opts=hprof",
"-XX:+EnableDynamicAgentLoading", "-Dlog4j.configurationFile=log4j2.xml"
);
private static final Set<String> JAVA_8 = new HashSet<>();
@@ -51,7 +51,7 @@ public enum ServerVersion {
static {
chatMap.put("21", ServerVersion.PAPER_21);
chatMap.put("1.21", ServerVersion.PAPER_21);
chatMap.put("1.21.5", ServerVersion.PAPER_21);
chatMap.put("1.21.3", ServerVersion.PAPER_21);
chatMap.put("20", ServerVersion.PAPER_20);
chatMap.put("1.20", ServerVersion.PAPER_20);
@@ -19,9 +19,11 @@
package de.steamwar.velocitycore.commands;
import de.steamwar.persistent.Subserver;
import de.steamwar.sql.SWException;
import de.steamwar.command.SWCommand;
import de.steamwar.messages.Chatter;
import de.steamwar.velocitycore.SubserverSystem;
public class BugCommand extends SWCommand {
public BugCommand() {
@@ -35,5 +37,9 @@ public class BugCommand extends SWCommand {
sender.withPlayerOrOffline(player -> player.getCurrentServer().map(connection -> connection.getServerInfo().getName()).orElse("offline"), () -> "offline") + " " + sender.user().getUserName() + " " + sender.user().getId()
);
sender.system("BUG_MESSAGE", id);
if (Subserver.isArena(Subserver.getSubserver(sender.getPlayer()))) {
sender.getPlayer().spoofChatInput("/techhiderbug");
}
}
}
@@ -19,9 +19,14 @@
package de.steamwar.velocitycore.commands;
import com.velocitypowered.api.network.ProtocolVersion;
import com.velocitypowered.api.proxy.ConnectionRequestBuilder;
import com.velocitypowered.api.proxy.server.ServerInfo;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.velocity.platform.VelocityViaAPI;
import com.viaversion.viaversion.velocity.platform.VelocityViaConfig;
import de.steamwar.persistent.Storage;
import de.steamwar.velocitycore.ServerVersion;
import de.steamwar.velocitycore.VelocityCore;
import de.steamwar.velocitycore.discord.DiscordBot;
import de.steamwar.velocitycore.inventory.SWItem;
@@ -405,6 +410,8 @@ public class TeamCommand extends SWCommand {
ServerInfo serverInfo = Storage.teamServers.computeIfAbsent(targetTeam.getTeamId(), integer -> {
ServerInfo info = new ServerInfo("Team " + targetTeam.getTeamKuerzel(), address);
VelocityCore.getProxy().registerServer(info);
// This is needed because otherwise ViaVersion uses the wrong version!
((VelocityViaConfig) Via.getConfig()).getVelocityServerProtocols().put(info.getName(), ProtocolVersion.MAXIMUM_VERSION.getProtocol());
return info;
});
@@ -33,6 +33,8 @@ import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier;
import com.velocitypowered.proxy.protocol.ProtocolUtils;
import de.steamwar.messages.Chatter;
import de.steamwar.network.packets.NetworkPacket;
import de.steamwar.sql.SteamwarUser;
import de.steamwar.sql.UserPerm;
import de.steamwar.velocitycore.VelocityCore;
import de.steamwar.velocitycore.commands.TeamCommand;
import de.steamwar.velocitycore.mods.*;
@@ -360,6 +362,23 @@ public class PluginMessage extends BasicListener {
))
channelRegisterHandlers.put(channel, player -> Chatter.disconnect(player).prefixless("MOD_YELLOW_SING", "minimap"));
for(String channel : Arrays.asList(
"flashback:remote_food_data",
"flashback:remote_set_slot",
"flashback:force_client_tick",
"flashback:accurate_entity_position",
"flashback:instantly_lerp",
"flashback:remote_experience",
"flashback:clear_particles",
"flashback:remote_select_hotbar_slot", // https://github.com/Moulberry/Flashback/tree/master/src/main/java/com/moulberry/flashback/packet
"flashback:clear_entities" // https://github.com/Moulberry/Flashback
))
channelRegisterHandlers.put(channel, player -> {
if (!SteamwarUser.get(player.getUniqueId()).hasPerm(UserPerm.RESTRICTED_MODS)) {
Chatter.disconnect(player).prefixless("MOD_YELLOW_SING", "flashback");
}
});
for(String channel : Arrays.asList("bedrockify:cauldron_particles", "bedrockify:eat-particles")) //https://github.com/juancarloscp52/BedrockIfy (Bedrock features on Java, banned for reach-around block placement)
channelRegisterHandlers.put(channel, player -> Chatter.disconnect(player).prefixless("MOD_YELLOW_SING", "bedrockify"));
@@ -386,7 +405,7 @@ public class PluginMessage extends BasicListener {
for(String channel : Arrays.asList(
"floodgate:skin",
"watut:nbt", //https://github.com/Corosauce/WATUT
"watut:nbt", "watut:nbt_server", //https://github.com/Corosauce/WATUT
"bclib:hello_server",
"vivecraft:data", //https://github.com/Vivecraft/VivecraftMod https://github.com/jrbudda/Vivecraft_Spigot_Extensions https://github.com/Techjar/Vivecraft_BungeeCord_Extensions (VR support)
"badpackets:channel_sync", //https://github.com/badasintended/badpackets (Forge fabric translation layer)