mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-04-20 02:08:15 +02:00
switch to JSpecify annotations
This commit is contained in:
@@ -31,17 +31,18 @@ index bc84b892cae5fe7019a3ad481e9da79956efa1fe..48eb5b00c460cccde29d327cef1d63fc
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/entity/LlamaJoinCaravanEvent.java b/src/main/java/org/purpurmc/purpur/event/entity/LlamaJoinCaravanEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..8849bb0becb16db907fa648cca2e98ab9d957c75
|
||||
index 0000000000000000000000000000000000000000..e34c37579dc8a5a108c03b9eff6bb916a910d867
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/entity/LlamaJoinCaravanEvent.java
|
||||
@@ -0,0 +1,61 @@
|
||||
@@ -0,0 +1,60 @@
|
||||
+package org.purpurmc.purpur.event.entity;
|
||||
+
|
||||
+import org.bukkit.entity.Llama;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jspecify.annotations.NullMarked;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a Llama tries to join a caravan.
|
||||
@@ -49,18 +50,19 @@ index 0000000000000000000000000000000000000000..8849bb0becb16db907fa648cca2e98ab
|
||||
+ * Cancelling the event will not let the Llama join. To prevent future attempts
|
||||
+ * at joining a caravan use {@link Llama#setShouldJoinCaravan(boolean)}.
|
||||
+ */
|
||||
+@NullMarked
|
||||
+public class LlamaJoinCaravanEvent extends EntityEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private boolean canceled;
|
||||
+ private final Llama head;
|
||||
+
|
||||
+ public LlamaJoinCaravanEvent(@NotNull Llama llama, @NotNull Llama head) {
|
||||
+ @ApiStatus.Internal
|
||||
+ public LlamaJoinCaravanEvent(Llama llama, Llama head) {
|
||||
+ super(llama);
|
||||
+ this.head = head;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public Llama getEntity() {
|
||||
+ return (Llama) entity;
|
||||
+ }
|
||||
@@ -70,7 +72,6 @@ index 0000000000000000000000000000000000000000..8849bb0becb16db907fa648cca2e98ab
|
||||
+ *
|
||||
+ * @return Llama about to be followed
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Llama getHead() {
|
||||
+ return head;
|
||||
+ }
|
||||
@@ -86,19 +87,17 @@ index 0000000000000000000000000000000000000000..8849bb0becb16db907fa648cca2e98ab
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/entity/LlamaLeaveCaravanEvent.java b/src/main/java/org/purpurmc/purpur/event/entity/LlamaLeaveCaravanEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c268c35b541a222d50875c29770c846a8ffcc4f8
|
||||
index 0000000000000000000000000000000000000000..23ea41ff5dc43a915a263aeb1a246705de8bf9e1
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/entity/LlamaLeaveCaravanEvent.java
|
||||
@@ -0,0 +1,34 @@
|
||||
@@ -107,31 +106,31 @@ index 0000000000000000000000000000000000000000..c268c35b541a222d50875c29770c846a
|
||||
+import org.bukkit.entity.Llama;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jspecify.annotations.NullMarked;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a Llama leaves a caravan
|
||||
+ */
|
||||
+@NullMarked
|
||||
+public class LlamaLeaveCaravanEvent extends EntityEvent {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+
|
||||
+ public LlamaLeaveCaravanEvent(@NotNull Llama llama) {
|
||||
+ @ApiStatus.Internal
|
||||
+ public LlamaLeaveCaravanEvent(Llama llama) {
|
||||
+ super(llama);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public Llama getEntity() {
|
||||
+ return (Llama) entity;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user