Compare commits

..

No commits in common. "development" and "16.8" have entirely different histories.

10 changed files with 11 additions and 61 deletions

14
pom.xml
View File

@ -6,7 +6,7 @@
<groupId>net.t2code</groupId> <groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId> <artifactId>T2CodeLib</artifactId>
<version>18.0_beta-2025-2</version> <version>16.7_beta-1</version>
<!--version>VERSION_snapshot-0</version--> <!--version>VERSION_snapshot-0</version-->
<!--version>VERSION_beta-0</version--> <!--version>VERSION_beta-0</version-->
<!--version>VERSION_dev-0</version--> <!--version>VERSION_dev-0</version-->
@ -44,6 +44,12 @@
</goals> </goals>
<configuration> <configuration>
<createDependencyReducedPom>false</createDependencyReducedPom> <createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
<relocation>
<pattern>net.kyori</pattern>
<shadedPattern>net.t2code.t2codelib.shaded.adventure</shadedPattern>
</relocation>
</relocations>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
@ -175,7 +181,7 @@
<dependency> <dependency>
<groupId>me.clip</groupId> <groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId> <artifactId>placeholderapi</artifactId>
<version>2.11.6</version> <version>2.11.3</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
@ -183,7 +189,7 @@
<dependency> <dependency>
<groupId>com.bencodez</groupId> <groupId>com.bencodez</groupId>
<artifactId>votingplugin</artifactId> <artifactId>votingplugin</artifactId>
<version>6.18.3</version> <version>6.12.1</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
@ -191,7 +197,7 @@
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId> <artifactId>adventure-text-minimessage</artifactId>
<version>4.19.0</version> <version>4.18.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -2,7 +2,6 @@ package net.t2code.t2codelib.BUNGEE.api.pluginMessaging;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.connection.Server;
import net.md_5.bungee.api.event.PluginMessageEvent; import net.md_5.bungee.api.event.PluginMessageEvent;
import net.md_5.bungee.api.plugin.Listener; import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.event.EventHandler; import net.md_5.bungee.event.EventHandler;
@ -16,10 +15,6 @@ public class T2CB_PluginMessageProxyCommand implements Listener {
@EventHandler @EventHandler
public void onPluginmessage(PluginMessageEvent event) { public void onPluginmessage(PluginMessageEvent event) {
if (event.getTag().equalsIgnoreCase(T2C_Util.getPluginChannel_ProxyCommand())) { if (event.getTag().equalsIgnoreCase(T2C_Util.getPluginChannel_ProxyCommand())) {
if (!(event.getSender() instanceof Server)) {
ProxyServer.getInstance().getConsole().sendMessage(T2C_Util.getPrefix() +" [Security] §cBlocked unauthorized plugin message from a player ("+ event.getSender().toString() +")!");
return;
}
event.setCancelled(true); event.setCancelled(true);
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData())); DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
try { try {

View File

@ -2,7 +2,6 @@ package net.t2code.t2codelib.BUNGEE.api.pluginMessaging.autoResponse;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.connection.Server;
import net.md_5.bungee.api.event.PluginMessageEvent; import net.md_5.bungee.api.event.PluginMessageEvent;
import net.md_5.bungee.api.plugin.Listener; import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.event.EventHandler; import net.md_5.bungee.event.EventHandler;
@ -18,10 +17,6 @@ public class T2CB_API_AutoResponse implements Listener {
@EventHandler @EventHandler
public void onPluginmessage(PluginMessageEvent event) { public void onPluginmessage(PluginMessageEvent event) {
if (event.getTag().equalsIgnoreCase(T2C_Util.getPluginChannel_AutoResponse())) { if (event.getTag().equalsIgnoreCase(T2C_Util.getPluginChannel_AutoResponse())) {
if (!(event.getSender() instanceof Server)) {
ProxyServer.getInstance().getConsole().sendMessage(T2C_Util.getPrefix() +" [Security] §cBlocked unauthorized plugin message from a player ("+ event.getSender().toString() +")!");
return;
}
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData())); DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
event.setCancelled(true); event.setCancelled(true);
try { try {

View File

@ -1,7 +1,6 @@
package net.t2code.t2codelib.BUNGEE.api.pluginMessaging.opSecurity; package net.t2code.t2codelib.BUNGEE.api.pluginMessaging.opSecurity;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.connection.Server;
import net.md_5.bungee.api.event.PluginMessageEvent; import net.md_5.bungee.api.event.PluginMessageEvent;
import net.md_5.bungee.api.plugin.Listener; import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.event.EventHandler; import net.md_5.bungee.event.EventHandler;
@ -15,10 +14,6 @@ public class T2CB_API_OpSecurity implements Listener {
@EventHandler @EventHandler
public void onPluginmessage(PluginMessageEvent event) { public void onPluginmessage(PluginMessageEvent event) {
if (event.getTag().equalsIgnoreCase(T2C_Util.getPluginChannel_OPSecurity())) { if (event.getTag().equalsIgnoreCase(T2C_Util.getPluginChannel_OPSecurity())) {
if (!(event.getSender() instanceof Server)) {
ProxyServer.getInstance().getConsole().sendMessage(T2C_Util.getPrefix() +" [Security] §cBlocked unauthorized plugin message from a player ("+ event.getSender().toString() +")!");
return;
}
event.setCancelled(true); event.setCancelled(true);
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData())); DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
try { try {

View File

@ -57,7 +57,6 @@ public class T2C_McVersion {
nms1_20_R4 = nms.contains("1_20_R4"); nms1_20_R4 = nms.contains("1_20_R4");
nms1_21_R1 = nms.contains("1_21_R1"); nms1_21_R1 = nms.contains("1_21_R1");
nms1_21_R2 = nms.contains("1_21_R2"); nms1_21_R2 = nms.contains("1_21_R2");
nms1_22_R1 = nms.contains("1_22_R1");
} }
private static String mcVersion; private static String mcVersion;
@ -105,7 +104,6 @@ public class T2C_McVersion {
private static boolean nms1_20_R4; private static boolean nms1_20_R4;
private static boolean nms1_21_R1; private static boolean nms1_21_R1;
private static boolean nms1_21_R2; private static boolean nms1_21_R2;
private static boolean nms1_22_R1;
public static String getMcVersion() { public static String getMcVersion() {
return mcVersion; return mcVersion;
@ -278,12 +276,6 @@ public class T2C_McVersion {
public static boolean isNms1_21_R1() { public static boolean isNms1_21_R1() {
return nms1_21_R1; return nms1_21_R1;
} }
public static boolean isNms1_21_R2() {
return nms1_21_R2;
}
public static boolean isNms1_22_R1() {
return nms1_22_R1;
}
public static boolean minMc1_8() { public static boolean minMc1_8() {

View File

@ -63,7 +63,7 @@ public class T2C_NmsVersions {
t2CnmsEnum = T2C_NmsEnum.v1_20_R3; t2CnmsEnum = T2C_NmsEnum.v1_20_R3;
} else if (mc.contains("(MC: 1.20.6)")) { } else if (mc.contains("(MC: 1.20.6)")) {
t2CnmsEnum = T2C_NmsEnum.v1_20_R4; t2CnmsEnum = T2C_NmsEnum.v1_20_R4;
} else if (mc.contains("(MC: 1.21)")|| mc.contains("(MC: 1.21.1)")) { } else if (mc.contains("(MC: 1.21)")) {
t2CnmsEnum = T2C_NmsEnum.v1_21_R1; t2CnmsEnum = T2C_NmsEnum.v1_21_R1;
} else t2CnmsEnum = T2C_NmsEnum.not_support; } else t2CnmsEnum = T2C_NmsEnum.not_support;

View File

@ -8,8 +8,6 @@ import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.connection.PluginMessageEvent; import com.velocitypowered.api.event.connection.PluginMessageEvent;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.ProxyServer; import com.velocitypowered.api.proxy.ProxyServer;
import com.velocitypowered.api.proxy.ServerConnection;
import net.kyori.adventure.text.Component;
import net.t2code.t2codelib.util.T2C_Util; import net.t2code.t2codelib.util.T2C_Util;
import net.t2code.t2codelib.VELOCITY.api.commands.T2CV_Cmd; import net.t2code.t2codelib.VELOCITY.api.commands.T2CV_Cmd;
import net.t2code.t2codelib.VELOCITY.system.T2CV_Main; import net.t2code.t2codelib.VELOCITY.system.T2CV_Main;
@ -32,12 +30,6 @@ public class T2CV_PluginMessageProxyCommand {
if (event.getIdentifier() != T2CV_Main.bcmd) { if (event.getIdentifier() != T2CV_Main.bcmd) {
return; return;
} }
if (!(event.getSource() instanceof ServerConnection)) {
T2CV_Main.getLogger().info(T2C_Util.getPrefix() +" [Security] §cBlocked unauthorized plugin message from a player ({})!", event.getSource().toString());
return;
}
ByteArrayDataInput stream = ByteStreams.newDataInput(event.getData()); ByteArrayDataInput stream = ByteStreams.newDataInput(event.getData());
String channel = stream.readUTF(); String channel = stream.readUTF();
String input = stream.readUTF(); String input = stream.readUTF();

View File

@ -6,12 +6,9 @@ import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.connection.PluginMessageEvent; import com.velocitypowered.api.event.connection.PluginMessageEvent;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.ProxyServer; import com.velocitypowered.api.proxy.ProxyServer;
import com.velocitypowered.api.proxy.ServerConnection;
import net.kyori.adventure.text.Component;
import net.t2code.t2codelib.VELOCITY.api.commands.T2CV_Cmd; import net.t2code.t2codelib.VELOCITY.api.commands.T2CV_Cmd;
import net.t2code.t2codelib.VELOCITY.api.messages.T2CV_Send; import net.t2code.t2codelib.VELOCITY.api.messages.T2CV_Send;
import net.t2code.t2codelib.VELOCITY.system.T2CV_Main; import net.t2code.t2codelib.VELOCITY.system.T2CV_Main;
import net.t2code.t2codelib.util.T2C_Util;
import org.slf4j.Logger; import org.slf4j.Logger;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
@ -33,12 +30,6 @@ public class T2CV_API_AutoResponse {
if (event.getIdentifier() != T2CV_Main.aresp) { if (event.getIdentifier() != T2CV_Main.aresp) {
return; return;
} }
if (!(event.getSource() instanceof ServerConnection)) {
T2CV_Main.getLogger().info(T2C_Util.getPrefix() +" [Security] §cBlocked unauthorized plugin message from a player ({})!", event.getSource().toString());
return;
}
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData())); DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
try { try {

View File

@ -5,11 +5,8 @@ package net.t2code.t2codelib.VELOCITY.api.pluginMessaging.opSecurity;
import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.connection.PluginMessageEvent; import com.velocitypowered.api.event.connection.PluginMessageEvent;
import com.velocitypowered.api.proxy.ProxyServer; import com.velocitypowered.api.proxy.ProxyServer;
import com.velocitypowered.api.proxy.ServerConnection;
import com.velocitypowered.api.proxy.server.RegisteredServer; import com.velocitypowered.api.proxy.server.RegisteredServer;
import net.kyori.adventure.text.Component;
import net.t2code.t2codelib.VELOCITY.system.T2CV_Main; import net.t2code.t2codelib.VELOCITY.system.T2CV_Main;
import net.t2code.t2codelib.util.T2C_Util;
import org.slf4j.Logger; import org.slf4j.Logger;
import java.io.*; import java.io.*;
@ -30,11 +27,6 @@ public class T2CV_API_OpSecurity {
return; return;
} }
if (!(event.getSource() instanceof ServerConnection)) {
T2CV_Main.getLogger().info(T2C_Util.getPrefix() +" [Security] §cBlocked unauthorized plugin message from a player ({})!", event.getSource().toString());
return;
}
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData())); DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
try { try {
String channel = stream.readUTF(); String channel = stream.readUTF();

View File

@ -10,9 +10,7 @@ import com.velocitypowered.api.event.connection.PluginMessageEvent;
import com.velocitypowered.api.event.connection.PostLoginEvent; import com.velocitypowered.api.event.connection.PostLoginEvent;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.ProxyServer; import com.velocitypowered.api.proxy.ProxyServer;
import com.velocitypowered.api.proxy.ServerConnection;
import com.velocitypowered.api.proxy.server.RegisteredServer; import com.velocitypowered.api.proxy.server.RegisteredServer;
import net.kyori.adventure.text.Component;
import net.t2code.t2codelib.SPIGOT.api.bungeePlayers.T2C_BngeePlayersEnum; import net.t2code.t2codelib.SPIGOT.api.bungeePlayers.T2C_BngeePlayersEnum;
import net.t2code.t2codelib.util.T2C_Util; import net.t2code.t2codelib.util.T2C_Util;
import net.t2code.t2codelib.VELOCITY.api.messages.T2CV_Send; import net.t2code.t2codelib.VELOCITY.api.messages.T2CV_Send;
@ -95,12 +93,6 @@ public class T2CV_Players {
if (event.getIdentifier() != T2CV_Main.bonlp) { if (event.getIdentifier() != T2CV_Main.bonlp) {
return; return;
} }
if (!(event.getSource() instanceof ServerConnection)) {
T2CV_Main.getLogger().info(T2C_Util.getPrefix() +" [Security] §cBlocked unauthorized plugin message from a player ({})!", event.getSource().toString());
return;
}
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData())); DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
try { try {