From 0bab608be721a2b9c824e045dbca2094c51ed2e0 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Tue, 21 May 2019 12:08:19 +1000 Subject: [PATCH] SPIGOT-4966: Provide access to Entity in PortalCreateEvent By: md_5 --- paper-server/nms-patches/BlockPortal.patch | 2 +- paper-server/nms-patches/EntityPlayer.patch | 2 +- paper-server/nms-patches/PortalTravelAgent.patch | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paper-server/nms-patches/BlockPortal.patch b/paper-server/nms-patches/BlockPortal.patch index 0f18e0f1be..60118245c6 100644 --- a/paper-server/nms-patches/BlockPortal.patch +++ b/paper-server/nms-patches/BlockPortal.patch @@ -121,7 +121,7 @@ + } + } + -+ PortalCreateEvent event = new PortalCreateEvent(blocks, bworld, PortalCreateEvent.CreateReason.FIRE); ++ PortalCreateEvent event = new PortalCreateEvent(blocks, bworld, null, PortalCreateEvent.CreateReason.FIRE); + this.a.getMinecraftWorld().getMinecraftServer().server.getPluginManager().callEvent(event); + + if (event.isCancelled()) { diff --git a/paper-server/nms-patches/EntityPlayer.patch b/paper-server/nms-patches/EntityPlayer.patch index 7991875c3b..cff6a76e20 100644 --- a/paper-server/nms-patches/EntityPlayer.patch +++ b/paper-server/nms-patches/EntityPlayer.patch @@ -454,7 +454,7 @@ + // CraftBukkit start + org.bukkit.World bworld = worldserver1.getWorld(); -+ org.bukkit.event.world.PortalCreateEvent portalEvent = new org.bukkit.event.world.PortalCreateEvent((List) (List) blockList.getList(), bworld, org.bukkit.event.world.PortalCreateEvent.CreateReason.END_PLATFORM); ++ org.bukkit.event.world.PortalCreateEvent portalEvent = new org.bukkit.event.world.PortalCreateEvent((List) (List) blockList.getList(), bworld, this.getBukkitEntity(), org.bukkit.event.world.PortalCreateEvent.CreateReason.END_PLATFORM); + + this.world.getServer().getPluginManager().callEvent(portalEvent); + if (!portalEvent.isCancelled()) { diff --git a/paper-server/nms-patches/PortalTravelAgent.patch b/paper-server/nms-patches/PortalTravelAgent.patch index 1d1f70090a..0984637330 100644 --- a/paper-server/nms-patches/PortalTravelAgent.patch +++ b/paper-server/nms-patches/PortalTravelAgent.patch @@ -37,7 +37,7 @@ + // CraftBukkit start + org.bukkit.World bworld = this.world.getWorld(); -+ org.bukkit.event.world.PortalCreateEvent event = new org.bukkit.event.world.PortalCreateEvent((java.util.List) (java.util.List) blockList.getList(), bworld, org.bukkit.event.world.PortalCreateEvent.CreateReason.NETHER_PAIR); ++ org.bukkit.event.world.PortalCreateEvent event = new org.bukkit.event.world.PortalCreateEvent((java.util.List) (java.util.List) blockList.getList(), bworld, entity.getBukkitEntity(), org.bukkit.event.world.PortalCreateEvent.CreateReason.NETHER_PAIR); + + this.world.getServer().getPluginManager().callEvent(event); + if (!event.isCancelled()) {