Swap some nullable annotations (#9696)

This commit is contained in:
Lulu13022002
2023-09-14 12:44:12 +02:00
parent 11f2c20c6a
commit abbdae4f53
9 changed files with 171 additions and 57 deletions

View File

@@ -18,6 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.bukkit.potion.PotionEffectType;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
@@ -25,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * Called when a player sets the effect for a beacon
+ */
+public class PlayerChangeBeaconEffectEvent extends PlayerEvent implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ private PotionEffectType primary;
+ private PotionEffectType secondary;
@@ -34,7 +35,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ private boolean isCancelled;
+
+ public PlayerChangeBeaconEffectEvent(@NotNull Player player, @Nullable PotionEffectType primary, @Nullable PotionEffectType secondary, @Nullable Block beacon) {
+ @ApiStatus.Internal
+ public PlayerChangeBeaconEffectEvent(@NotNull Player player, @Nullable PotionEffectType primary, @Nullable PotionEffectType secondary, @NotNull Block beacon) {
+ super(player);
+ this.primary = primary;
+ this.secondary = secondary;
@@ -80,9 +82,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ /**
+ * @return the beacon block associated with this event, or null if not found
+ * @return the beacon block associated with this event
+ */
+ @Nullable
+ @NotNull
+ public Block getBeacon() {
+ return beacon;
+ }
@@ -143,11 +145,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ @Override
+ public @NotNull HandlerList getHandlers() {
+ return handlers;
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ return HANDLER_LIST;
+ }
+}