aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0184-Add-PlayerAttackEntityCooldownResetEvent.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/api/0184-Add-PlayerAttackEntityCooldownResetEvent.patch')
-rw-r--r--patches/api/0184-Add-PlayerAttackEntityCooldownResetEvent.patch16
1 files changed, 8 insertions, 8 deletions
diff --git a/patches/api/0184-Add-PlayerAttackEntityCooldownResetEvent.patch b/patches/api/0184-Add-PlayerAttackEntityCooldownResetEvent.patch
index c3cfd0642b..3d2999a705 100644
--- a/patches/api/0184-Add-PlayerAttackEntityCooldownResetEvent.patch
+++ b/patches/api/0184-Add-PlayerAttackEntityCooldownResetEvent.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Add PlayerAttackEntityCooldownResetEvent
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerAttackEntityCooldownResetEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerAttackEntityCooldownResetEvent.java
new file mode 100644
-index 0000000000000000000000000000000000000000..5ceaff1a499d08575ddcdcbead8e2cef6cfbea47
+index 0000000000000000000000000000000000000000..2cd5c9c344cacbabe64dae8ec87babb506b5fb09
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerAttackEntityCooldownResetEvent.java
@@ -0,0 +1,77 @@
@@ -18,22 +18,23 @@ index 0000000000000000000000000000000000000000..5ceaff1a499d08575ddcdcbead8e2cef
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.jetbrains.annotations.ApiStatus;
-+import org.jetbrains.annotations.NotNull;
++import org.jspecify.annotations.NullMarked;
+
+/**
+ * Called when processing a player's attack on an entity when the player's attack strength cooldown is reset
+ */
++@NullMarked
+public class PlayerAttackEntityCooldownResetEvent extends PlayerEvent implements Cancellable {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
-+ @NotNull private final Entity attackedEntity;
++ private final Entity attackedEntity;
+ private final float cooledAttackStrength;
+
+ private boolean cancelled;
+
+ @ApiStatus.Internal
-+ public PlayerAttackEntityCooldownResetEvent(@NotNull Player player, @NotNull Entity attackedEntity, float cooledAttackStrength) {
++ public PlayerAttackEntityCooldownResetEvent(final Player player, final Entity attackedEntity, final float cooledAttackStrength) {
+ super(player);
+ this.attackedEntity = attackedEntity;
+ this.cooledAttackStrength = cooledAttackStrength;
@@ -53,7 +54,6 @@ index 0000000000000000000000000000000000000000..5ceaff1a499d08575ddcdcbead8e2cef
+ *
+ * @return the entity attacked by the player
+ */
-+ @NotNull
+ public Entity getAttackedEntity() {
+ return this.attackedEntity;
+ }
@@ -74,16 +74,16 @@ index 0000000000000000000000000000000000000000..5ceaff1a499d08575ddcdcbead8e2cef
+ * Cancelling this event will prevent the target player from having their cooldown reset from attacking this entity
+ */
+ @Override
-+ public void setCancelled(boolean cancel) {
++ public void setCancelled(final boolean cancel) {
+ this.cancelled = cancel;
+ }
+
+ @Override
-+ public @NotNull HandlerList getHandlers() {
++ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
-+ public static @NotNull HandlerList getHandlerList() {
++ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
+}