Begin switching to JSpecify annotations (#11448)
* Begin switching to JSpecify annotations * more * fixes
This commit is contained in:
parent
fa1f6a5d78
commit
64e918335c
62 changed files with 580 additions and 750 deletions
|
@ -18,11 +18,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jspecify.annotations.NullMarked;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a {@link Tameable} dies and sends a death message.
|
||||
+ */
|
||||
+@NullMarked
|
||||
+public class TameableDeathMessageEvent extends EntityEvent implements Cancellable {
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
|
@ -31,7 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ private boolean cancelled;
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public TameableDeathMessageEvent(@NotNull Tameable tameable, @NotNull Component deathMessage) {
|
||||
+ public TameableDeathMessageEvent(final Tameable tameable, final Component deathMessage) {
|
||||
+ super(tameable);
|
||||
+ this.deathMessage = deathMessage;
|
||||
+ }
|
||||
|
@ -41,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ *
|
||||
+ * @param deathMessage Death message to appear
|
||||
+ */
|
||||
+ public void deathMessage(@NotNull Component deathMessage) {
|
||||
+ public void deathMessage(final Component deathMessage) {
|
||||
+ this.deathMessage = deathMessage;
|
||||
+ }
|
||||
+
|
||||
|
@ -50,12 +51,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ *
|
||||
+ * @return Death message to appear
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Component deathMessage() {
|
||||
+ return this.deathMessage;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public Tameable getEntity() {
|
||||
+ return (Tameable) super.getEntity();
|
||||
|
@ -67,17 +66,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ public void setCancelled(final boolean cancel) {
|
||||
+ 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