Merge pull request #534 from PimvanderLoos/master

Support latest ProtocolLib
This commit is contained in:
libraryaddict 2021-01-05 06:43:22 +13:00 committed by GitHub
commit 4adcc8aa53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -76,9 +76,9 @@
<version>1.18.10</version>
</dependency>
<dependency>
<groupId>com.comphenix.protocol</groupId>
<groupId>com.github.dmulloy2</groupId>
<artifactId>ProtocolLib</artifactId>
<version>4.5.0</version>
<version>master-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
@ -112,8 +112,8 @@
<repositories>
<repository>
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/nexus/repository/public/</url>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<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.PacketEvent;
import com.comphenix.protocol.reflect.StructureModifier;
import com.comphenix.protocol.utility.ByteBuddyGenerated;
import me.libraryaddict.disguise.DisguiseAPI;
import me.libraryaddict.disguise.LibsDisguises;
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
return;
if (player instanceof com.comphenix.net.sf.cglib.proxy.Factory || player.getVehicle() != null) {
if (player instanceof ByteBuddyGenerated || player.getVehicle() != null) {
return;
}
@ -250,7 +251,7 @@ public class PacketListenerInventory extends PacketAdapter {
Player player = event.getPlayer();
// 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) {
return;
}