[ci skip] Cleanup events (#10202)

This commit is contained in:
Lulu13022002 2024-02-01 10:15:57 +01:00 committed by GitHub
parent b3c81089ae
commit 294347bee2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
295 changed files with 3245 additions and 3088 deletions

View file

@ -6,10 +6,10 @@ Subject: [PATCH] PlayerElytraBoostEvent
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerElytraBoostEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerElytraBoostEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..e9a76a25fa5445905a09dbc2fd5b35bff56d80b3
index 0000000000000000000000000000000000000000..42375d44ed0db457b96165414e9b45a557bac1ab
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerElytraBoostEvent.java
@@ -0,0 +1,85 @@
@@ -0,0 +1,90 @@
+package com.destroystokyo.paper.event.player;
+
+import org.bukkit.entity.Firework;
@ -18,18 +18,23 @@ index 0000000000000000000000000000000000000000..e9a76a25fa5445905a09dbc2fd5b35bf
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.bukkit.inventory.ItemStack;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Fired when a player boosts elytra flight with a firework
+ */
+public class PlayerElytraBoostEvent extends PlayerEvent implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private boolean cancelled = false;
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ @NotNull private final ItemStack itemStack;
+ @NotNull private Firework firework;
+ @NotNull private final Firework firework;
+ private boolean consume = true;
+
+ private boolean cancelled;
+
+ @ApiStatus.Internal
+ public PlayerElytraBoostEvent(@NotNull Player player, @NotNull ItemStack itemStack, @NotNull Firework firework) {
+ super(player);
+ this.itemStack = itemStack;
@ -43,7 +48,7 @@ index 0000000000000000000000000000000000000000..e9a76a25fa5445905a09dbc2fd5b35bf
+ */
+ @NotNull
+ public ItemStack getItemStack() {
+ return itemStack;
+ return this.itemStack;
+ }
+
+ /**
@ -53,45 +58,45 @@ index 0000000000000000000000000000000000000000..e9a76a25fa5445905a09dbc2fd5b35bf
+ */
+ @NotNull
+ public Firework getFirework() {
+ return firework;
+ return this.firework;
+ }
+
+ /**
+ * Get whether to consume the firework or not
+ *
+ * @return True to consume
+ * @return {@code true} to consume
+ */
+ public boolean shouldConsume() {
+ return consume;
+ return this.consume;
+ }
+
+ /**
+ * Set whether to consume the firework or not
+ *
+ * @param consume True to consume
+ * @param consume {@code true} to consume
+ */
+ public void setShouldConsume(boolean consume) {
+ this.consume = consume;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return cancelled;
+ return this.cancelled;
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ cancelled = cancel;
+ this.cancelled = cancel;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
+}