Support latest ProtocolLib

- Switched to JitPack for the ProtocolLib repository. See dmulloy2/ProtocolLib#1047.
- Using the new interface of generated classes when checking if a player is a proxy player. See dmulloy2/ProtocolLib#1053.
This commit is contained in:
Pim van der Loos 2021-01-04 11:59:46 +01:00
parent c3d6dd1b43
commit 06ac4f8ffc
No known key found for this signature in database
GPG Key ID: C16F020ADAE6D5A8
2 changed files with 7 additions and 6 deletions

View File

@ -76,9 +76,9 @@
<version>1.18.10</version> <version>1.18.10</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.comphenix.protocol</groupId> <groupId>com.github.dmulloy2</groupId>
<artifactId>ProtocolLib</artifactId> <artifactId>ProtocolLib</artifactId>
<version>4.5.0</version> <version>master-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
@ -112,8 +112,8 @@
<repositories> <repositories>
<repository> <repository>
<id>dmulloy2-repo</id> <id>jitpack.io</id>
<url>https://repo.dmulloy2.net/nexus/repository/public/</url> <url>https://jitpack.io</url>
</repository> </repository>
<repository> <repository>
<id>md_5-releases</id> <id>md_5-releases</id>

View File

@ -8,6 +8,7 @@ import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.events.PacketContainer;
import com.comphenix.protocol.events.PacketEvent; import com.comphenix.protocol.events.PacketEvent;
import com.comphenix.protocol.reflect.StructureModifier; import com.comphenix.protocol.reflect.StructureModifier;
import com.comphenix.protocol.utility.ByteBuddyGenerated;
import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseAPI;
import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.LibsDisguises;
import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.Disguise;
@ -44,7 +45,7 @@ public class PacketListenerInventory extends PacketAdapter {
if (player.getName().contains("UNKNOWN[")) // If the player is temporary if (player.getName().contains("UNKNOWN[")) // If the player is temporary
return; return;
if (player instanceof com.comphenix.net.sf.cglib.proxy.Factory || player.getVehicle() != null) { if (player instanceof ByteBuddyGenerated || player.getVehicle() != null) {
return; return;
} }
@ -250,7 +251,7 @@ public class PacketListenerInventory extends PacketAdapter {
Player player = event.getPlayer(); Player player = event.getPlayer();
// If the inventory is the players inventory // If the inventory is the players inventory
if (player instanceof com.comphenix.net.sf.cglib.proxy.Factory || player.getVehicle() != null || if (player instanceof ByteBuddyGenerated || player.getVehicle() != null ||
event.getPacket().getIntegers().read(0) != 0) { event.getPacket().getIntegers().read(0) != 0) {
return; return;
} }