aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0384-Improve-PortalEvents.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/api/0384-Improve-PortalEvents.patch')
-rw-r--r--patches/api/0384-Improve-PortalEvents.patch42
1 files changed, 30 insertions, 12 deletions
diff --git a/patches/api/0384-Improve-PortalEvents.patch b/patches/api/0384-Improve-PortalEvents.patch
index 87e49ffb0e..88c76230fd 100644
--- a/patches/api/0384-Improve-PortalEvents.patch
+++ b/patches/api/0384-Improve-PortalEvents.patch
@@ -84,13 +84,21 @@ index 6818e9f0ba32ca1a1e612703f7526b29f5a6438f..d3724db0a5a67cde15b05fecd32b2ca3
@Override
public HandlerList getHandlers() {
diff --git a/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java b/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java
-index 67fb9d93e808e907fa980f3004d415ae5d0a53fc..97e36c7f6e09276fbae20eaeee0965566332ca46 100644
+index d70400236b08217ba675e560877f951ea4f143ca..4544e7e155619a6ae31cbb2999ae3dedfd3b5f4b 100644
--- a/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java
-@@ -15,15 +15,58 @@ import org.jetbrains.annotations.Nullable;
- public class EntityPortalEvent extends EntityTeleportEvent {
- private static final HandlerList handlers = new HandlerList();
+@@ -3,6 +3,7 @@ package org.bukkit.event.entity;
+ import org.bukkit.Location;
+ import org.bukkit.entity.Entity;
+ import org.bukkit.event.HandlerList;
++import org.jetbrains.annotations.ApiStatus;
+ import org.jetbrains.annotations.NotNull;
+ import org.jetbrains.annotations.Nullable;
+
+@@ -17,23 +18,68 @@ public class EntityPortalEvent extends EntityTeleportEvent {
private int searchRadius = 128;
+ private boolean canCreatePortal = true;
+ private int creationRadius = 16;
+ private final org.bukkit.PortalType type; // Paper
public EntityPortalEvent(@NotNull final Entity entity, @NotNull final Location from, @Nullable final Location to) {
@@ -102,15 +110,24 @@ index 67fb9d93e808e907fa980f3004d415ae5d0a53fc..97e36c7f6e09276fbae20eaeee096556
super(entity, from, to);
this.searchRadius = searchRadius;
+ this.type = org.bukkit.PortalType.CUSTOM; // Paper
+ }
+
+ public EntityPortalEvent(@NotNull Entity entity, @NotNull Location from, @Nullable Location to, int searchRadius, boolean canCreatePortal, int creationRadius) {
++ // Paper start
++ this(entity, from, to, searchRadius, canCreatePortal, creationRadius, org.bukkit.PortalType.CUSTOM);
+ }
+
-+ // Paper start
-+ public EntityPortalEvent(@NotNull Entity entity, @NotNull Location from, @Nullable Location to, int searchRadius, final @NotNull org.bukkit.PortalType portalType) {
-+ super(entity, from, to);
-+ this.searchRadius = searchRadius;
++ @ApiStatus.Internal
++ public EntityPortalEvent(@NotNull Entity entity, @NotNull Location from, @Nullable Location to, int searchRadius, boolean canCreatePortal, int creationRadius, final @NotNull org.bukkit.PortalType portalType) {
+ super(entity, from, to);
+ this.type = portalType;
-+ }
-+
++ // Paper end
+ this.searchRadius = searchRadius;
+ this.canCreatePortal = canCreatePortal;
+ this.creationRadius = creationRadius;
+ }
+
++ // Paper start
+ /**
+ * Get the portal type relating to this event.
+ *
@@ -142,11 +159,12 @@ index 67fb9d93e808e907fa980f3004d415ae5d0a53fc..97e36c7f6e09276fbae20eaeee096556
+ @Override
+ public void setTo(@Nullable final Location to) {
+ super.setTo(to);
- }
++ }
+ // Paper end
-
++
/**
* Set the Block radius to search in for available portals.
+ *
diff --git a/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java b/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java
index 57eeeafae84f83a939925820e827769749ff27ec..929a997671de8202efb9da97fbf9b4a0bf7c37e8 100644
--- a/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java