mirror of
https://github.com/TotalFreedomMC/TF-LibsDisguises.git
synced 2025-02-11 11:40:29 +00:00
Call event in scheduler as listener is async
This commit is contained in:
parent
a704f5e51c
commit
e6752903b4
1 changed files with 7 additions and 1 deletions
|
@ -21,6 +21,7 @@ import org.bukkit.Bukkit;
|
|||
import org.bukkit.entity.*;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
public class PacketListenerClientInteract extends PacketAdapter {
|
||||
public PacketListenerClientInteract(LibsDisguises plugin) {
|
||||
|
@ -69,8 +70,13 @@ public class PacketListenerClientInteract extends PacketAdapter {
|
|||
DisguiseInteractEvent selfEvent = new DisguiseInteractEvent((TargetedDisguise) disguise, handUsed,
|
||||
interactType == EnumWrappers.EntityUseAction.ATTACK);
|
||||
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Bukkit.getPluginManager().callEvent(selfEvent);
|
||||
}
|
||||
}.runTask(LibsDisguises.getInstance());
|
||||
}
|
||||
}
|
||||
|
||||
for (ItemStack item : new ItemStack[]{observer.getInventory().getItemInMainHand(),
|
||||
|
|
Loading…
Reference in a new issue