Finish converting all events to jspecify annotations
This commit is contained in:
parent
fa97c59a4e
commit
29a25df60e
78 changed files with 757 additions and 883 deletions
|
@ -30,7 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+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 whenever a players shield is disabled due to an attack from another entity that was capable of disabling the
|
||||
|
@ -41,6 +41,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ * It follows that, if this event is cancelled, no {@link PlayerItemCooldownEvent} is called as the shield is never
|
||||
+ * disabled in the first place.
|
||||
+ */
|
||||
+@NullMarked
|
||||
+public class PlayerShieldDisableEvent extends PlayerEvent implements Cancellable {
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
|
@ -51,7 +52,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ private boolean cancelled;
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public PlayerShieldDisableEvent(@NotNull final Player player, @NotNull final Entity damager, final int cooldown) {
|
||||
+ public PlayerShieldDisableEvent(final Player player, final Entity damager, final int cooldown) {
|
||||
+ super(player);
|
||||
+ this.damager = damager;
|
||||
+ this.cooldown = cooldown;
|
||||
|
@ -62,7 +63,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ *
|
||||
+ * @return the entity instance that damaged the player in a way that caused the shield to be disabled.
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Entity getDamager() {
|
||||
+ return this.damager;
|
||||
+ }
|
||||
|
@ -87,7 +87,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ *
|
||||
+ * @param cooldown cooldown in ticks, has to be a positive number
|
||||
+ */
|
||||
+ public void setCooldown(int cooldown) {
|
||||
+ public void setCooldown(final int cooldown) {
|
||||
+ Preconditions.checkArgument(cooldown >= 0, "The cooldown has to be equal to or greater than 0!");
|
||||
+ this.cooldown = cooldown;
|
||||
+ }
|
||||
|
@ -102,13 +102,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ this.cancelled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue