mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-09-24 03:32:41 +02:00
Bump required nms version, some custom payload handling
This commit is contained in:
parent
b6bc5af73a
commit
599083c8b0
@ -42,7 +42,7 @@
|
|||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.github.dmulloy2</groupId>
|
||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.github.dmulloy2</groupId>
|
||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.github.dmulloy2</groupId>
|
||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.github.dmulloy2</groupId>
|
||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.github.dmulloy2</groupId>
|
||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.github.dmulloy2</groupId>
|
||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.github.dmulloy2</groupId>
|
||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.github.dmulloy2</groupId>
|
||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.github.dmulloy2</groupId>
|
||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@
|
|||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.github.dmulloy2</groupId>
|
||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -611,7 +611,7 @@ public class DisguiseUtilities {
|
|||||||
|
|
||||||
// If you're on 1.20.4
|
// If you're on 1.20.4
|
||||||
if (NmsVersion.v1_20_R3.isSupported()) {
|
if (NmsVersion.v1_20_R3.isSupported()) {
|
||||||
requiredVersion = new String[]{"5.2.0", "676"};
|
requiredVersion = new String[]{"5.2.0", "679"};
|
||||||
}
|
}
|
||||||
|
|
||||||
return requiredVersion;
|
return requiredVersion;
|
||||||
|
@ -11,6 +11,7 @@ import me.libraryaddict.disguise.disguisetypes.DisguiseType;
|
|||||||
import me.libraryaddict.disguise.utilities.listeners.ModdedListener;
|
import me.libraryaddict.disguise.utilities.listeners.ModdedListener;
|
||||||
import me.libraryaddict.disguise.utilities.packets.packetlisteners.PacketListenerModdedClient;
|
import me.libraryaddict.disguise.utilities.packets.packetlisteners.PacketListenerModdedClient;
|
||||||
import me.libraryaddict.disguise.utilities.parser.DisguisePerm;
|
import me.libraryaddict.disguise.utilities.parser.DisguisePerm;
|
||||||
|
import me.libraryaddict.disguise.utilities.reflection.NmsVersion;
|
||||||
import me.libraryaddict.disguise.utilities.reflection.ReflectionManager;
|
import me.libraryaddict.disguise.utilities.reflection.ReflectionManager;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.NamespacedKey;
|
import org.bukkit.NamespacedKey;
|
||||||
@ -44,6 +45,11 @@ public class ModdedManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO Implement newer forge methods of registering a modded server
|
||||||
|
if (NmsVersion.v1_20_R2.isSupported()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (fmlRegistries == null && DisguiseConfig.isLoginPayloadPackets()) {
|
if (fmlRegistries == null && DisguiseConfig.isLoginPayloadPackets()) {
|
||||||
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketListenerModdedClient());
|
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketListenerModdedClient());
|
||||||
Bukkit.getPluginManager().registerEvents(new ModdedListener(), LibsDisguises.getInstance());
|
Bukkit.getPluginManager().registerEvents(new ModdedListener(), LibsDisguises.getInstance());
|
||||||
|
@ -28,7 +28,9 @@ public class PacketListenerClientCustomPayload extends PacketAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (NmsVersion.v1_20_R2.isSupported()) {
|
if (NmsVersion.v1_20_R2.isSupported()) {
|
||||||
// TODO Add support when PL 5.1.1 is available in maven
|
if (!event.getPacket().getCustomPacketPayloads().read(0).getId().getFullKey().equals("minecraft:brand")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
} else if (NmsVersion.v1_13.isSupported()) {
|
} else if (NmsVersion.v1_13.isSupported()) {
|
||||||
if (!event.getPacket().getMinecraftKeys().read(0).getFullKey().equals("minecraft:brand")) {
|
if (!event.getPacket().getMinecraftKeys().read(0).getFullKey().equals("minecraft:brand")) {
|
||||||
|
@ -98,7 +98,7 @@ public class PacketListenerModdedClient extends PacketAdapter {
|
|||||||
public void onPacketReceiving(PacketEvent event) {
|
public void onPacketReceiving(PacketEvent event) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
if (event.getPacketType() != PacketType.Login.Client.START) {
|
if (event.getPacketType() == PacketType.Login.Client.CUSTOM_PAYLOAD) {
|
||||||
String address = event.getPlayer().getAddress().toString();
|
String address = event.getPlayer().getAddress().toString();
|
||||||
|
|
||||||
String name = loginAttempts.getIfPresent(address);
|
String name = loginAttempts.getIfPresent(address);
|
||||||
|
10
pom.xml
10
pom.xml
@ -23,7 +23,7 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|
||||||
<lombok.version>1.18.26</lombok.version>
|
<lombok.version>1.18.26</lombok.version>
|
||||||
<protocollib.version>5.0.0</protocollib.version>
|
<protocollib.version>80aa420</protocollib.version>
|
||||||
<spigot.version>1.20.3-R0.1-SNAPSHOT</spigot.version>
|
<spigot.version>1.20.3-R0.1-SNAPSHOT</spigot.version>
|
||||||
<junit.version>4.13.2</junit.version>
|
<junit.version>4.13.2</junit.version>
|
||||||
<junit-jupiter.version>5.9.3</junit-jupiter.version>
|
<junit-jupiter.version>5.9.3</junit-jupiter.version>
|
||||||
@ -35,14 +35,8 @@
|
|||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!--<dependency>
|
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
|
||||||
<artifactId>ProtocolLib</artifactId>
|
|
||||||
<version>${protocollib.version}</version>
|
|
||||||
<optional>true</optional>
|
|
||||||
</dependency>-->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.github.dmulloy2</groupId>
|
||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
<version>${protocollib.version}</version>
|
<version>${protocollib.version}</version>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.github.dmulloy2</groupId>
|
||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
Loading…
Reference in New Issue
Block a user