Begin switching to JSpecify annotations (#11448)
* Begin switching to JSpecify annotations * more * fixes
This commit is contained in:
@@ -19,22 +19,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import org.bukkit.event.Event;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jspecify.annotations.NullMarked;
|
||||
+
|
||||
+/**
|
||||
+ * This event gets called when the whitelist status of a player is changed
|
||||
+ */
|
||||
+@NullMarked
|
||||
+public class WhitelistStateUpdateEvent extends Event implements Cancellable {
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
+
|
||||
+ @NotNull private final PlayerProfile playerProfile;
|
||||
+ @NotNull private final WhitelistStatus status;
|
||||
+ private final PlayerProfile playerProfile;
|
||||
+ private final WhitelistStatus status;
|
||||
+
|
||||
+ private boolean cancelled;
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public WhitelistStateUpdateEvent(@NotNull PlayerProfile playerProfile, @NotNull WhitelistStatus status) {
|
||||
+ public WhitelistStateUpdateEvent(final PlayerProfile playerProfile, final WhitelistStatus status) {
|
||||
+ this.playerProfile = playerProfile;
|
||||
+ this.status = status;
|
||||
+ }
|
||||
@@ -44,7 +45,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @return the player whose status is being changed
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public OfflinePlayer getPlayer() {
|
||||
+ return Bukkit.getOfflinePlayer(this.playerProfile.getId());
|
||||
+ }
|
||||
@@ -54,7 +54,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @return the player profile whose status is being changed
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public PlayerProfile getPlayerProfile() {
|
||||
+ return this.playerProfile;
|
||||
+ }
|
||||
@@ -64,7 +63,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @return the whitelist status
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public WhitelistStatus getStatus() {
|
||||
+ return this.status;
|
||||
+ }
|
||||
@@ -75,17 +73,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;
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user