aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0262-Introduce-beacon-activation-deactivation-events.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/api/0262-Introduce-beacon-activation-deactivation-events.patch')
-rw-r--r--patches/api/0262-Introduce-beacon-activation-deactivation-events.patch28
1 files changed, 12 insertions, 16 deletions
diff --git a/patches/api/0262-Introduce-beacon-activation-deactivation-events.patch b/patches/api/0262-Introduce-beacon-activation-deactivation-events.patch
index 4e173b3d6c..a108599dc9 100644
--- a/patches/api/0262-Introduce-beacon-activation-deactivation-events.patch
+++ b/patches/api/0262-Introduce-beacon-activation-deactivation-events.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Introduce beacon activation/deactivation events
diff --git a/src/main/java/io/papermc/paper/event/block/BeaconActivatedEvent.java b/src/main/java/io/papermc/paper/event/block/BeaconActivatedEvent.java
new file mode 100644
-index 0000000000000000000000000000000000000000..05609ec9df637c9aa53528218cbc8cda30f0aea1
+index 0000000000000000000000000000000000000000..380538656e675fdfaf9077da8ff48dc5c427a657
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/block/BeaconActivatedEvent.java
-@@ -0,0 +1,43 @@
+@@ -0,0 +1,41 @@
+package io.papermc.paper.event.block;
+
+import org.bukkit.block.Beacon;
@@ -17,18 +17,19 @@ index 0000000000000000000000000000000000000000..05609ec9df637c9aa53528218cbc8cda
+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,28 +38,25 @@ index 0000000000000000000000000000000000000000..05609ec9df637c9aa53528218cbc8cda
+ *
+ * @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;
+ }
+}
diff --git a/src/main/java/io/papermc/paper/event/block/BeaconDeactivatedEvent.java b/src/main/java/io/papermc/paper/event/block/BeaconDeactivatedEvent.java
new file mode 100644
-index 0000000000000000000000000000000000000000..dc106d6bfbd9d0ab84b17597d71381a5c0b07d64
+index 0000000000000000000000000000000000000000..4e5b2b2413e2aae03132ecd76123cd93dfbd77ce
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/block/BeaconDeactivatedEvent.java
-@@ -0,0 +1,46 @@
+@@ -0,0 +1,44 @@
+package io.papermc.paper.event.block;
+
+import org.bukkit.Material;
@@ -67,18 +65,19 @@ index 0000000000000000000000000000000000000000..dc106d6bfbd9d0ab84b17597d71381a5
+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..dc106d6bfbd9d0ab84b17597d71381a5
+ *
+ * @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;
+ }