From 71bc2b07ed8f4255f3db673d06009bdfd80e18d1 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Wed, 10 Jul 2024 19:43:43 +1000 Subject: [PATCH] SPIGOT-7827: Sync EntityPortalEvent with PlayerPortalEvent since non-players can now create portals By: md_5 --- .../nms-patches/net/minecraft/world/entity/Entity.patch | 2 +- .../java/org/bukkit/craftbukkit/event/CraftPortalEvent.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paper-server/nms-patches/net/minecraft/world/entity/Entity.patch b/paper-server/nms-patches/net/minecraft/world/entity/Entity.patch index 76cf023a33..86ac3ad825 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/Entity.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/Entity.patch @@ -861,7 +861,7 @@ + org.bukkit.entity.Entity bukkitEntity = entity.getBukkitEntity(); + Location enter = bukkitEntity.getLocation(); + -+ EntityPortalEvent event = new EntityPortalEvent(bukkitEntity, enter, exit, searchRadius); ++ EntityPortalEvent event = new EntityPortalEvent(bukkitEntity, enter, exit, searchRadius, true, creationRadius); + event.getEntity().getServer().getPluginManager().callEvent(event); + if (event.isCancelled() || event.getTo() == null || event.getTo().getWorld() == null || !entity.isAlive()) { + return null; diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftPortalEvent.java b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftPortalEvent.java index 7732350d43..07712e75da 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftPortalEvent.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftPortalEvent.java @@ -19,8 +19,8 @@ public class CraftPortalEvent { to = portalEvent.getTo(); searchRadius = portalEvent.getSearchRadius(); cancelled = portalEvent.isCancelled(); - creationRadius = 0; - canCreatePortal = false; + creationRadius = portalEvent.getCreationRadius(); + canCreatePortal = portalEvent.getCanCreatePortal(); } public CraftPortalEvent(PlayerPortalEvent portalEvent) {