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 EntityInsideBlockEvent
diff --git a/src/main/java/io/papermc/paper/event/entity/EntityInsideBlockEvent.java b/src/main/java/io/papermc/paper/event/entity/EntityInsideBlockEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..b162d4b6f12c0d7d3542ada3bdae24471a16d622
index 0000000000000000000000000000000000000000..314aab3eb4c802e6ebbe5a4ee7d5fbbd3f504c1b
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/entity/EntityInsideBlockEvent.java
@@ -0,0 +1,87 @@
@@ -0,0 +1,85 @@
+package io.papermc.paper.event.entity;
+
+import org.bukkit.block.Block;
@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..b162d4b6f12c0d7d3542ada3bdae2447
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jspecify.annotations.NullMarked;
+
+/**
+ * Called when an entity enters the hitbox of a block.
@ -53,6 +53,7 @@ index 0000000000000000000000000000000000000000..b162d4b6f12c0d7d3542ada3bdae2447
+ * <li>Wither rose</li>
+ * </ul>
+ */
+@NullMarked
+public class EntityInsideBlockEvent extends EntityEvent implements Cancellable {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
@ -61,7 +62,7 @@ index 0000000000000000000000000000000000000000..b162d4b6f12c0d7d3542ada3bdae2447
+ private boolean cancelled;
+
+ @ApiStatus.Internal
+ public EntityInsideBlockEvent(@NotNull Entity entity, @NotNull Block block) {
+ public EntityInsideBlockEvent(final Entity entity, final Block block) {
+ super(entity);
+ this.block = block;
+ }
@ -71,7 +72,6 @@ index 0000000000000000000000000000000000000000..b162d4b6f12c0d7d3542ada3bdae2447
+ *
+ * @return the block
+ */
+ @NotNull
+ public Block getBlock() {
+ return this.block;
+ }
@ -82,17 +82,15 @@ index 0000000000000000000000000000000000000000..b162d4b6f12c0d7d3542ada3bdae2447
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ public void setCancelled(final boolean cancel) {
+ this.cancelled = cancel;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }