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