Fix error on 1.12
This commit is contained in:
parent
c60d676244
commit
57a4507de9
2
pom.xml
2
pom.xml
@ -5,7 +5,7 @@
|
||||
<!-- A good example on why temporary names for project identification shouldn't be used -->
|
||||
<groupId>LibsDisguises</groupId>
|
||||
<artifactId>LibsDisguises</artifactId>
|
||||
<version>10.0.9</version>
|
||||
<version>10.0.9-SNAPSHOT</version>
|
||||
|
||||
<build>
|
||||
<defaultGoal>exec:java clean install</defaultGoal>
|
||||
|
@ -6,6 +6,7 @@ import com.comphenix.protocol.events.PacketAdapter;
|
||||
import com.comphenix.protocol.events.PacketContainer;
|
||||
import com.comphenix.protocol.events.PacketEvent;
|
||||
import me.libraryaddict.disguise.LibsDisguises;
|
||||
import me.libraryaddict.disguise.utilities.reflection.NmsVersion;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
@ -23,8 +24,14 @@ public class PacketListenerChannelRegister extends PacketAdapter {
|
||||
|
||||
@Override
|
||||
public void onPacketReceiving(PacketEvent event) {
|
||||
if (!event.getPacket().getMinecraftKeys().read(0).getFullKey().equals("minecraft:brand")) {
|
||||
return;
|
||||
if (NmsVersion.v1_13.isSupported()) {
|
||||
if (!event.getPacket().getMinecraftKeys().read(0).getFullKey().equals("minecraft:brand")) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!event.getPacket().getStrings().read(0).equals("MC|Brand")) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
new BukkitRunnable() {
|
||||
|
Loading…
Reference in New Issue
Block a user