Begin switching to JSpecify annotations (#11448)
* Begin switching to JSpecify annotations * more * fixes
This commit is contained in:
@@ -17,18 +17,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.block.BlockEvent;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jspecify.annotations.NullMarked;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a beacon is activated.
|
||||
+ * Activation occurs when the beacon beam becomes visible.
|
||||
+ */
|
||||
+@NullMarked
|
||||
+public class BeaconActivatedEvent extends BlockEvent {
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public BeaconActivatedEvent(@NotNull Block block) {
|
||||
+ public BeaconActivatedEvent(final Block block) {
|
||||
+ super(block);
|
||||
+ }
|
||||
+
|
||||
@@ -37,18 +38,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @return the beacon that was activated.
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Beacon getBeacon() {
|
||||
+ return (Beacon) this.block.getState();
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
@@ -67,18 +65,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.block.BlockEvent;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+import org.jspecify.annotations.NullMarked;
|
||||
+import org.jspecify.annotations.Nullable;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a beacon is deactivated, either because its base block(s) or itself were destroyed.
|
||||
+ */
|
||||
+@NullMarked
|
||||
+public class BeaconDeactivatedEvent extends BlockEvent {
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public BeaconDeactivatedEvent(@NotNull Block block) {
|
||||
+ public BeaconDeactivatedEvent(final Block block) {
|
||||
+ super(block);
|
||||
+ }
|
||||
+
|
||||
@@ -89,18 +88,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @return The beacon that got deactivated, or {@code null} if it does not exist.
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public Beacon getBeacon() {
|
||||
+ public @Nullable Beacon getBeacon() {
|
||||
+ return this.block.getType() == Material.BEACON ? (Beacon) this.block.getState() : null;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user