[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

@@ -39,7 +39,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+import org.bukkit.entity.Player;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.bukkit.inventory.ItemStack;
@@ -49,9 +48,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * Called when a player is firing a bow and the server is choosing an arrow to use.
+ */
+public class PlayerReadyArrowEvent extends PlayerEvent implements Cancellable {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ @NotNull private final ItemStack bow;
+ @NotNull private final ItemStack arrow;
+
+ private boolean cancelled;
+
+ public PlayerReadyArrowEvent(@NotNull Player player, @NotNull ItemStack bow, @NotNull ItemStack arrow) {
+ super(player);
+ this.bow = bow;
@@ -63,7 +67,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ @NotNull
+ public ItemStack getBow() {
+ return bow;
+ return this.bow;
+ }
+
+ /**
@@ -71,37 +75,34 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ @NotNull
+ public ItemStack getArrow() {
+ return arrow;
+ return this.arrow;
+ }
+
+ private static final HandlerList handlers = new HandlerList();
+
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+
+ private boolean cancelled = false;
+
+ /**
+ * Whether or not use of this arrow is cancelled. On cancel, the server will try the next arrow available and fire another event.
+ * {@inheritDoc}
+ * <br>
+ * Whether use of this arrow is cancelled. On cancel, the server will try the next arrow available and fire another event.
+ */
+ @Override
+ public boolean isCancelled() {
+ return cancelled;
+ return this.cancelled;
+ }
+
+ /**
+ * Cancel use of this arrow. On cancel, the server will try the next arrow available and fire another event.
+ * @param cancel true if you wish to cancel this event
+ */
+ @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;
+ }
+}