[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

@@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+package com.destroystokyo.paper.event.entity;
+
+import org.bukkit.entity.Slime;
+import org.bukkit.event.Cancellable;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+/**
@@ -22,9 +22,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * This event does not fire for the entity's actual movement. Only when it
+ * is choosing to change direction.
+ */
+public class SlimeChangeDirectionEvent extends SlimePathfindEvent implements Cancellable {
+public class SlimeChangeDirectionEvent extends SlimePathfindEvent {
+
+ private float yaw;
+
+ @ApiStatus.Internal
+ public SlimeChangeDirectionEvent(@NotNull Slime slime, float yaw) {
+ super(slime);
+ this.yaw = yaw;
@@ -36,7 +38,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @return Chosen yaw
+ */
+ public float getNewYaw() {
+ return yaw;
+ return this.yaw;
+ }
+
+ /**
@@ -60,6 +62,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+/**
@@ -69,6 +72,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * is choosing to start moving.
+ */
+public class SlimePathfindEvent extends EntityEvent implements Cancellable {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ private boolean cancelled;
+
+ @ApiStatus.Internal
+ public SlimePathfindEvent(@NotNull Slime slime) {
+ super(slime);
+ }
@@ -80,31 +89,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ @NotNull
+ public Slime getEntity() {
+ return (Slime) entity;
+ return (Slime) super.getEntity();
+ }
+
+ private static final HandlerList handlers = new HandlerList();
+
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+
+ private boolean cancelled = false;
+
+ @Override
+ public boolean isCancelled() {
+ return cancelled;
+ return this.cancelled;
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ cancelled = cancel;
+ this.cancelled = cancel;
+ }
+
+ @NotNull
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SlimeSwimEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SlimeSwimEvent.java
@@ -116,7 +121,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+package com.destroystokyo.paper.event.entity;
+
+import org.bukkit.entity.Slime;
+import org.bukkit.event.Cancellable;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+/**
@@ -125,7 +130,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * This event does not fire for the entity's actual movement. Only when it
+ * is choosing to start jumping.
+ */
+public class SlimeSwimEvent extends SlimeWanderEvent implements Cancellable {
+public class SlimeSwimEvent extends SlimeWanderEvent {
+
+ @ApiStatus.Internal
+ public SlimeSwimEvent(@NotNull Slime slime) {
+ super(slime);
+ }
@@ -140,7 +147,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.entity.Slime;
+import org.bukkit.event.Cancellable;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+/**
@@ -149,9 +156,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * This event does not fire for the entity's actual movement. Only when it
+ * is choosing to start moving.
+ */
+public class SlimeTargetLivingEntityEvent extends SlimePathfindEvent implements Cancellable {
+public class SlimeTargetLivingEntityEvent extends SlimePathfindEvent {
+
+ @NotNull private final LivingEntity target;
+
+ @ApiStatus.Internal
+ public SlimeTargetLivingEntityEvent(@NotNull Slime slime, @NotNull LivingEntity target) {
+ super(slime);
+ this.target = target;
@@ -164,7 +173,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ @NotNull
+ public LivingEntity getTarget() {
+ return target;
+ return this.target;
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SlimeWanderEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SlimeWanderEvent.java
@@ -176,7 +185,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+package com.destroystokyo.paper.event.entity;
+
+import org.bukkit.entity.Slime;
+import org.bukkit.event.Cancellable;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+/**
@@ -185,7 +194,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * This event does not fire for the entity's actual movement. Only when it
+ * is choosing to start moving.
+ */
+public class SlimeWanderEvent extends SlimePathfindEvent implements Cancellable {
+public class SlimeWanderEvent extends SlimePathfindEvent {
+
+ @ApiStatus.Internal
+ public SlimeWanderEvent(@NotNull Slime slime) {
+ super(slime);
+ }