[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

@@ -19,6 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+/**
@@ -26,11 +27,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+public class PlayerStartSpectatingEntityEvent extends PlayerEvent implements Cancellable {
+
+ private static final HandlerList handlers = new HandlerList();
+ private boolean cancelled;
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ @NotNull private final Entity currentSpectatorTarget;
+ @NotNull private final Entity newSpectatorTarget;
+
+ private boolean cancelled;
+
+ @ApiStatus.Internal
+ public PlayerStartSpectatingEntityEvent(@NotNull Player player, @NotNull Entity currentSpectatorTarget, @NotNull Entity newSpectatorTarget) {
+ super(player);
+ this.currentSpectatorTarget = currentSpectatorTarget;
@@ -44,7 +48,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ @NotNull
+ public Entity getCurrentSpectatorTarget() {
+ return currentSpectatorTarget;
+ return this.currentSpectatorTarget;
+ }
+
+ /**
@@ -54,12 +58,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ @NotNull
+ public Entity getNewSpectatorTarget() {
+ return newSpectatorTarget;
+ return this.newSpectatorTarget;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return cancelled;
+ return this.cancelled;
+ }
+
+ @Override
@@ -70,12 +74,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ return HANDLER_LIST;
+ }
+}
+
@@ -92,6 +96,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+/**
@@ -99,10 +104,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+public class PlayerStopSpectatingEntityEvent extends PlayerEvent implements Cancellable {
+
+ private static final HandlerList handlers = new HandlerList();
+ private boolean cancelled;
+ @NotNull private final Entity spectatorTarget;
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ @NotNull private final Entity spectatorTarget;
+ private boolean cancelled;
+
+ @ApiStatus.Internal
+ public PlayerStopSpectatingEntityEvent(@NotNull Player player, @NotNull Entity spectatorTarget) {
+ super(player);
+ this.spectatorTarget = spectatorTarget;
@@ -115,12 +122,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ @NotNull
+ public Entity getSpectatorTarget() {
+ return spectatorTarget;
+ return this.spectatorTarget;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return cancelled;
+ return this.cancelled;
+ }
+
+ @Override
@@ -131,11 +138,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ return HANDLER_LIST;
+ }
+}