fix EntityDismountEvent being fired on gen threads

This commit is contained in:
Shane Freeder 2020-06-29 14:48:24 +01:00
parent 849ede2317
commit d84b4a3b26

View file

@ -18,6 +18,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
VehicleExitEvent event = new VehicleExitEvent(
(Vehicle) getBukkitEntity(),
(LivingEntity) entity.getBukkitEntity(), !suppressCancellation // Paper
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
// CraftBukkit end
// Spigot start
org.spigotmc.event.entity.EntityDismountEvent event = new org.spigotmc.event.entity.EntityDismountEvent(entity.getBukkitEntity(), this.getBukkitEntity(), !suppressCancellation); // Paper
- Bukkit.getPluginManager().callEvent(event);
+ if (MCUtil.isMainThread()) Bukkit.getPluginManager().callEvent(event); // Paper
if (event.isCancelled()) {
return false;
}
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java