Support latest ProtocolLib version

This commit is contained in:
filoghost 2021-05-24 10:20:32 +02:00
parent ffd0351a70
commit bbb397068b
3 changed files with 8 additions and 9 deletions

View File

@ -5,7 +5,6 @@
*/
package me.filoghost.holographicdisplays.bridge.protocollib;
import com.comphenix.net.sf.cglib.proxy.Factory;
import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.events.ListenerPriority;
@ -58,14 +57,14 @@ class PacketListener extends PacketAdapter {
@Override
public void onPacketSending(PacketEvent event) {
if (event.isPlayerTemporary()) {
return;
}
PacketContainer packet = event.getPacket();
PacketType packetType = packet.getType();
Player player = event.getPlayer();
if (player instanceof Factory) {
return; // Ignore temporary players (reference: https://github.com/dmulloy2/ProtocolLib/issues/349)
}
int entityID = packet.getIntegers().read(0);
if (entityID < 0) {
return;

View File

@ -41,8 +41,8 @@ public class ProtocolLibHook {
String versionNumbers = versionNumbersMatcher.group();
if (!VersionUtils.isVersionGreaterEqual(versionNumbers, "4.1")) {
errorCollector.add("detected old version of ProtocolLib, support disabled. You must use ProtocolLib 4.1 or higher");
if (!VersionUtils.isVersionGreaterEqual(versionNumbers, "4.4")) {
errorCollector.add("detected old unsupported version of ProtocolLib, support disabled. You must use ProtocolLib 4.4.0 or higher");
return;
}

View File

@ -54,7 +54,7 @@
<repository>
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/nexus/repository/public/</url>
<url>https://repo.dmulloy2.net/repository/public/</url>
</repository>
</repositories>
@ -196,7 +196,7 @@
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>4.2.1</version>
<version>4.5.0</version>
<scope>provided</scope>
</dependency>