mirror of
https://github.com/TotalFreedomMC/TF-LibsDisguises.git
synced 2024-11-11 01:17:16 +00:00
Fix a new error for 1.17
This commit is contained in:
parent
cffa7591d9
commit
afe4022920
1 changed files with 9 additions and 1 deletions
|
@ -16,6 +16,7 @@ import me.libraryaddict.disguise.disguisetypes.TargetedDisguise;
|
||||||
import me.libraryaddict.disguise.disguisetypes.watchers.*;
|
import me.libraryaddict.disguise.disguisetypes.watchers.*;
|
||||||
import me.libraryaddict.disguise.events.DisguiseInteractEvent;
|
import me.libraryaddict.disguise.events.DisguiseInteractEvent;
|
||||||
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
|
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
|
||||||
|
import me.libraryaddict.disguise.utilities.reflection.NmsVersion;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Axolotl;
|
import org.bukkit.entity.Axolotl;
|
||||||
|
@ -81,7 +82,14 @@ public class PacketListenerClientInteract extends PacketAdapter {
|
||||||
// The type of interact, we don't care the difference with "Interact_At" however as it's not
|
// The type of interact, we don't care the difference with "Interact_At" however as it's not
|
||||||
// useful
|
// useful
|
||||||
// for self disguises
|
// for self disguises
|
||||||
EnumWrappers.EntityUseAction interactType = packet.getEntityUseActions().read(0);
|
EnumWrappers.EntityUseAction interactType;
|
||||||
|
|
||||||
|
if (NmsVersion.v1_17.isSupported()) {
|
||||||
|
interactType = packet.getEnumEntityUseActions().read(0).getAction();
|
||||||
|
} else {
|
||||||
|
interactType = packet.getEntityUseActions().read(0);
|
||||||
|
}
|
||||||
|
|
||||||
final EquipmentSlot handUsed;
|
final EquipmentSlot handUsed;
|
||||||
|
|
||||||
// Attack has a null hand, which throws an error if you attempt to fetch
|
// Attack has a null hand, which throws an error if you attempt to fetch
|
||||||
|
|
Loading…
Reference in a new issue