Begin switching to JSpecify annotations (#11448)

* Begin switching to JSpecify annotations

* more

* fixes
This commit is contained in:
Jake Potrebic 2024-09-29 12:52:13 -07:00 committed by GitHub
parent 6d7a438fad
commit f9c7f2a5c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
66 changed files with 750 additions and 920 deletions

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Add EntityPortalReadyEvent
diff --git a/src/main/java/io/papermc/paper/event/entity/EntityPortalReadyEvent.java b/src/main/java/io/papermc/paper/event/entity/EntityPortalReadyEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..3450735c86a8af45491c010a796262ae892f14dc
index 0000000000000000000000000000000000000000..bc5f0ed43f5d341ec551e48eecf2614cdfd52d79
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/entity/EntityPortalReadyEvent.java
@@ -0,0 +1,94 @@
@@ -0,0 +1,95 @@
+package io.papermc.paper.event.entity;
+
+import org.bukkit.PortalType;
@ -21,28 +21,29 @@ index 0000000000000000000000000000000000000000..3450735c86a8af45491c010a796262ae
+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;
+import org.jspecify.annotations.NullMarked;
+import org.jspecify.annotations.Nullable;
+
+/**
+ * Called when an entity is ready to be teleported by a plugin.
+ * Currently this is only called after the required
+ * Currently, this is only called after the required
+ * ticks have passed for a Nether Portal.
+ * <p>
+ * Cancelling this event resets the entity's readiness
+ * regarding the current portal.
+ */
+@NullMarked
+public class EntityPortalReadyEvent extends EntityEvent implements Cancellable {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ private final PortalType portalType;
+ private World targetWorld;
+ private @Nullable World targetWorld;
+
+ private boolean cancelled;
+
+ @ApiStatus.Internal
+ public EntityPortalReadyEvent(final @NotNull Entity entity, final @Nullable World targetWorld, final @NotNull PortalType portalType) {
+ public EntityPortalReadyEvent(final Entity entity, final @Nullable World targetWorld, final PortalType portalType) {
+ super(entity);
+ this.targetWorld = targetWorld;
+ this.portalType = portalType;
@ -81,7 +82,7 @@ index 0000000000000000000000000000000000000000..3450735c86a8af45491c010a796262ae
+ *
+ * @return the portal type
+ */
+ public @NotNull PortalType getPortalType() {
+ public PortalType getPortalType() {
+ return this.portalType;
+ }
+
@ -96,11 +97,11 @@ index 0000000000000000000000000000000000000000..3450735c86a8af45491c010a796262ae
+ }
+
+ @Override
+ public @NotNull HandlerList getHandlers() {
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ public static @NotNull HandlerList getHandlerList() {
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
+}