mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 01:47:42 +01:00
switch to JSpecify annotations
This commit is contained in:
@@ -6,10 +6,10 @@ Subject: [PATCH] Added goat ram event
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/entity/GoatRamEntityEvent.java b/src/main/java/org/purpurmc/purpur/event/entity/GoatRamEntityEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..f62c14f3d4999e9112c1c73642aa337d97b94b5a
|
||||
index 0000000000000000000000000000000000000000..f0a7fe694db145294ff93d320382d1baecc68702
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/entity/GoatRamEntityEvent.java
|
||||
@@ -0,0 +1,59 @@
|
||||
@@ -0,0 +1,58 @@
|
||||
+package org.purpurmc.purpur.event.entity;
|
||||
+
|
||||
+import org.bukkit.entity.Goat;
|
||||
@@ -17,17 +17,20 @@ index 0000000000000000000000000000000000000000..f62c14f3d4999e9112c1c73642aa337d
|
||||
+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 goat rams an entity
|
||||
+ */
|
||||
+@NullMarked
|
||||
+public class GoatRamEntityEvent extends EntityEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final LivingEntity rammedEntity;
|
||||
+ private boolean cancelled;
|
||||
+
|
||||
+ public GoatRamEntityEvent(@NotNull Goat goat, @NotNull LivingEntity rammedEntity) {
|
||||
+ @ApiStatus.Internal
|
||||
+ public GoatRamEntityEvent(Goat goat, LivingEntity rammedEntity) {
|
||||
+ super(goat);
|
||||
+ this.rammedEntity = rammedEntity;
|
||||
+ }
|
||||
@@ -37,24 +40,20 @@ index 0000000000000000000000000000000000000000..f62c14f3d4999e9112c1c73642aa337d
|
||||
+ *
|
||||
+ * @return The rammed entity
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public LivingEntity getRammedEntity() {
|
||||
+ return this.rammedEntity;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public Goat getEntity() {
|
||||
+ return (Goat) super.getEntity();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user