[ci skip] Cleanup events (#10202)
This commit is contained in:
@@ -18,6 +18,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.bukkit.event.entity.EntityPortalEvent;
|
||||
+import org.bukkit.event.player.PlayerPortalEvent;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
@@ -33,10 +36,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
+
|
||||
+ private World targetWorld;
|
||||
+ private final PortalType portalType;
|
||||
+ private World targetWorld;
|
||||
+
|
||||
+ private boolean cancelled;
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public EntityPortalReadyEvent(final @NotNull Entity entity, final @Nullable World targetWorld, final @NotNull PortalType portalType) {
|
||||
+ super(entity);
|
||||
+ this.targetWorld = targetWorld;
|
||||
@@ -45,25 +50,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the world this portal will teleport to.
|
||||
+ * Can be null if "allow-nether" is false in server.properties
|
||||
+ * Can be {@code null} if "allow-nether" is false in server.properties
|
||||
+ * or if there is another situation where there is no world to teleport to.
|
||||
+ * <p>
|
||||
+ * This world may be modified by later events such as {@link org.bukkit.event.player.PlayerPortalEvent}
|
||||
+ * or {@link org.bukkit.event.entity.EntityPortalEvent}.
|
||||
+ * This world may be modified by later events such as {@link PlayerPortalEvent}
|
||||
+ * or {@link EntityPortalEvent}.
|
||||
+ *
|
||||
+ * @return the world the portal will teleport the entity to.
|
||||
+ */
|
||||
+ public @Nullable World getTargetWorld() {
|
||||
+ return targetWorld;
|
||||
+ return this.targetWorld;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the world this portal will teleport to. A null value
|
||||
+ * Sets the world this portal will teleport to. A {@code null} value
|
||||
+ * will essentially cancel the teleport and prevent further events
|
||||
+ * such as {@link org.bukkit.event.player.PlayerPortalEvent} from firing.
|
||||
+ * such as {@link PlayerPortalEvent} from firing.
|
||||
+ * <p>
|
||||
+ * This world may be modified by later events such as {@link org.bukkit.event.player.PlayerPortalEvent}
|
||||
+ * or {@link org.bukkit.event.entity.EntityPortalEvent}.
|
||||
+ * This world may be modified by later events such as {@link PlayerPortalEvent}
|
||||
+ * or {@link EntityPortalEvent}.
|
||||
+ *
|
||||
+ * @param targetWorld the world
|
||||
+ */
|
||||
@@ -77,12 +82,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ * @return the portal type
|
||||
+ */
|
||||
+ public @NotNull PortalType getPortalType() {
|
||||
+ return portalType;
|
||||
+ return this.portalType;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return cancelled;
|
||||
+ return this.cancelled;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
|
||||
Reference in New Issue
Block a user