diff --git a/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/util/PlayerlistTrackerEntry.java b/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/util/PlayerlistTrackerEntry.java index f2ddb7a3d..70c349ee8 100644 --- a/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/util/PlayerlistTrackerEntry.java +++ b/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/util/PlayerlistTrackerEntry.java @@ -58,8 +58,8 @@ public class PlayerlistTrackerEntry extends EntityTrackerEntry { return; skinnable.getSkinTracker().updateViewer(entityplayer.getBukkitEntity()); } - Bukkit.getPluginManager().callEvent( - new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), entityplayer.getBukkitEntity())); + Bukkit.getPluginManager().callEvent(new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), + entityplayer.getBukkitEntity(), !Bukkit.isPrimaryThread())); } } } diff --git a/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/util/PlayerlistTrackerEntry.java b/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/util/PlayerlistTrackerEntry.java index 18b8776e8..e07be211d 100644 --- a/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/util/PlayerlistTrackerEntry.java +++ b/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/util/PlayerlistTrackerEntry.java @@ -106,8 +106,8 @@ public class PlayerlistTrackerEntry extends EntityTrackerEntry { public void updateLastPlayer(EntityPlayer lastUpdatedPlayer) { if (lastUpdatedPlayer != null) { - Bukkit.getPluginManager().callEvent( - new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), lastUpdatedPlayer.getBukkitEntity())); + Bukkit.getPluginManager().callEvent(new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), + lastUpdatedPlayer.getBukkitEntity(), !Bukkit.isPrimaryThread())); } } diff --git a/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/util/PlayerlistTrackerEntry.java b/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/util/PlayerlistTrackerEntry.java index a72ec8b1c..defdd3204 100644 --- a/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/util/PlayerlistTrackerEntry.java +++ b/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/util/PlayerlistTrackerEntry.java @@ -107,8 +107,8 @@ public class PlayerlistTrackerEntry extends EntityTrackerEntry { public void updateLastPlayer(EntityPlayer lastUpdatedPlayer) { if (lastUpdatedPlayer != null) { - Bukkit.getPluginManager().callEvent( - new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), lastUpdatedPlayer.getBukkitEntity())); + Bukkit.getPluginManager().callEvent(new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), + lastUpdatedPlayer.getBukkitEntity(), !Bukkit.isPrimaryThread())); } } diff --git a/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/util/PlayerlistTrackerEntry.java b/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/util/PlayerlistTrackerEntry.java index 77d283278..1f73cf516 100644 --- a/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/util/PlayerlistTrackerEntry.java +++ b/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/util/PlayerlistTrackerEntry.java @@ -107,8 +107,8 @@ public class PlayerlistTrackerEntry extends EntityTrackerEntry { public void updateLastPlayer(EntityPlayer lastUpdatedPlayer) { if (lastUpdatedPlayer != null) { - Bukkit.getPluginManager().callEvent( - new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), lastUpdatedPlayer.getBukkitEntity())); + Bukkit.getPluginManager().callEvent(new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), + lastUpdatedPlayer.getBukkitEntity(), !Bukkit.isPrimaryThread())); } } diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/util/PlayerlistTracker.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/util/PlayerlistTracker.java index 04410974c..338a087d6 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/util/PlayerlistTracker.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/util/PlayerlistTracker.java @@ -108,8 +108,8 @@ public class PlayerlistTracker extends PlayerChunkMap.EntityTracker { public void updateLastPlayer(EntityPlayer lastUpdatedPlayer) { if (lastUpdatedPlayer != null) { - Bukkit.getPluginManager().callEvent( - new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), lastUpdatedPlayer.getBukkitEntity())); + Bukkit.getPluginManager().callEvent(new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), + lastUpdatedPlayer.getBukkitEntity(), !Bukkit.isPrimaryThread())); } } diff --git a/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/util/PlayerlistTracker.java b/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/util/PlayerlistTracker.java index 21d6ce703..a5ae74bad 100644 --- a/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/util/PlayerlistTracker.java +++ b/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/util/PlayerlistTracker.java @@ -108,8 +108,8 @@ public class PlayerlistTracker extends PlayerChunkMap.EntityTracker { public void updateLastPlayer(EntityPlayer lastUpdatedPlayer) { if (lastUpdatedPlayer != null) { - Bukkit.getPluginManager().callEvent( - new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), lastUpdatedPlayer.getBukkitEntity())); + Bukkit.getPluginManager().callEvent(new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), + lastUpdatedPlayer.getBukkitEntity(), !Bukkit.isPrimaryThread())); } } diff --git a/v1_16_R3/src/main/java/net/citizensnpcs/nms/v1_16_R3/util/PlayerlistTracker.java b/v1_16_R3/src/main/java/net/citizensnpcs/nms/v1_16_R3/util/PlayerlistTracker.java index e228355b8..03ca6f9ab 100644 --- a/v1_16_R3/src/main/java/net/citizensnpcs/nms/v1_16_R3/util/PlayerlistTracker.java +++ b/v1_16_R3/src/main/java/net/citizensnpcs/nms/v1_16_R3/util/PlayerlistTracker.java @@ -108,8 +108,8 @@ public class PlayerlistTracker extends PlayerChunkMap.EntityTracker { public void updateLastPlayer(EntityPlayer lastUpdatedPlayer) { if (lastUpdatedPlayer != null) { - Bukkit.getPluginManager().callEvent( - new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), lastUpdatedPlayer.getBukkitEntity())); + Bukkit.getPluginManager().callEvent(new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), + lastUpdatedPlayer.getBukkitEntity(), !Bukkit.isPrimaryThread())); } } diff --git a/v1_17_R1/src/main/java/net/citizensnpcs/nms/v1_17_R1/util/PlayerlistTracker.java b/v1_17_R1/src/main/java/net/citizensnpcs/nms/v1_17_R1/util/PlayerlistTracker.java index c75d27805..8c3077943 100644 --- a/v1_17_R1/src/main/java/net/citizensnpcs/nms/v1_17_R1/util/PlayerlistTracker.java +++ b/v1_17_R1/src/main/java/net/citizensnpcs/nms/v1_17_R1/util/PlayerlistTracker.java @@ -38,7 +38,7 @@ public class PlayerlistTracker extends ChunkMap.TrackedEntity { boolean res = super.add(conn); if (res) { Bukkit.getPluginManager().callEvent(new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), - conn.getPlayer().getBukkitEntity())); + conn.getPlayer().getBukkitEntity(), !Bukkit.isPrimaryThread())); } return res; } diff --git a/v1_18_R2/src/main/java/net/citizensnpcs/nms/v1_18_R2/util/PlayerlistTracker.java b/v1_18_R2/src/main/java/net/citizensnpcs/nms/v1_18_R2/util/PlayerlistTracker.java index 2fcd1ede1..e7c34088a 100644 --- a/v1_18_R2/src/main/java/net/citizensnpcs/nms/v1_18_R2/util/PlayerlistTracker.java +++ b/v1_18_R2/src/main/java/net/citizensnpcs/nms/v1_18_R2/util/PlayerlistTracker.java @@ -38,7 +38,7 @@ public class PlayerlistTracker extends ChunkMap.TrackedEntity { boolean res = super.add(conn); if (res) { Bukkit.getPluginManager().callEvent(new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), - conn.getPlayer().getBukkitEntity())); + conn.getPlayer().getBukkitEntity(), !Bukkit.isPrimaryThread())); } return res; } diff --git a/v1_19_R3/src/main/java/net/citizensnpcs/nms/v1_19_R3/util/CitizensEntityTracker.java b/v1_19_R3/src/main/java/net/citizensnpcs/nms/v1_19_R3/util/CitizensEntityTracker.java index 06b70ef9f..60600b6c0 100644 --- a/v1_19_R3/src/main/java/net/citizensnpcs/nms/v1_19_R3/util/CitizensEntityTracker.java +++ b/v1_19_R3/src/main/java/net/citizensnpcs/nms/v1_19_R3/util/CitizensEntityTracker.java @@ -38,7 +38,7 @@ public class CitizensEntityTracker extends ChunkMap.TrackedEntity { boolean res = super.add(conn); if (res) { Bukkit.getPluginManager().callEvent(new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), - conn.getPlayer().getBukkitEntity())); + conn.getPlayer().getBukkitEntity(), !Bukkit.isPrimaryThread())); } return res; } diff --git a/v1_20_R4/src/main/java/net/citizensnpcs/nms/v1_20_R4/util/CitizensEntityTracker.java b/v1_20_R4/src/main/java/net/citizensnpcs/nms/v1_20_R4/util/CitizensEntityTracker.java index 9faafe988..5417315d1 100644 --- a/v1_20_R4/src/main/java/net/citizensnpcs/nms/v1_20_R4/util/CitizensEntityTracker.java +++ b/v1_20_R4/src/main/java/net/citizensnpcs/nms/v1_20_R4/util/CitizensEntityTracker.java @@ -38,7 +38,7 @@ public class CitizensEntityTracker extends ChunkMap.TrackedEntity { boolean res = super.add(conn); if (res) { Bukkit.getPluginManager().callEvent(new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), - conn.getPlayer().getBukkitEntity())); + conn.getPlayer().getBukkitEntity(), !Bukkit.isPrimaryThread())); } return res; } diff --git a/v1_8_R3/src/main/java/net/citizensnpcs/nms/v1_8_R3/util/PlayerlistTrackerEntry.java b/v1_8_R3/src/main/java/net/citizensnpcs/nms/v1_8_R3/util/PlayerlistTrackerEntry.java index aa13b6f87..669dac457 100644 --- a/v1_8_R3/src/main/java/net/citizensnpcs/nms/v1_8_R3/util/PlayerlistTrackerEntry.java +++ b/v1_8_R3/src/main/java/net/citizensnpcs/nms/v1_8_R3/util/PlayerlistTrackerEntry.java @@ -105,8 +105,8 @@ public class PlayerlistTrackerEntry extends EntityTrackerEntry { public void updateLastPlayer(EntityPlayer lastUpdatedPlayer) { if (lastUpdatedPlayer != null) { - Bukkit.getPluginManager().callEvent( - new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), lastUpdatedPlayer.getBukkitEntity())); + Bukkit.getPluginManager().callEvent(new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), + lastUpdatedPlayer.getBukkitEntity(), !Bukkit.isPrimaryThread())); lastUpdatedPlayer = null; } }