mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2025-01-20 06:41:20 +01:00
Support latest ProtocolLib version
This commit is contained in:
parent
ffd0351a70
commit
bbb397068b
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
4
pom.xml
4
pom.xml
@ -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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user