[ci skip] Cleanup events (#10202)

This commit is contained in:
Lulu13022002
2024-02-01 10:15:57 +01:00
parent d676979ea0
commit f7e469eb2e
187 changed files with 2415 additions and 2258 deletions

View File

@@ -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