From d84b4a3b26f2e97122fefb580d620fca8f4168c5 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 29 Jun 2020 14:48:24 +0100 Subject: [PATCH] fix EntityDismountEvent being fired on gen threads --- ...-fire-unleash-dismount-events-from-worldgen-thr.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Spigot-Server-Patches/Don-t-fire-unleash-dismount-events-from-worldgen-thr.patch b/Spigot-Server-Patches/Don-t-fire-unleash-dismount-events-from-worldgen-thr.patch index 4c4ef29049..4ebbffab02 100644 --- a/Spigot-Server-Patches/Don-t-fire-unleash-dismount-events-from-worldgen-thr.patch +++ b/Spigot-Server-Patches/Don-t-fire-unleash-dismount-events-from-worldgen-thr.patch @@ -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