Begin switching to JSpecify annotations (#11448)

* Begin switching to JSpecify annotations

* more

* fixes
This commit is contained in:
Jake Potrebic
2024-09-29 12:52:13 -07:00
parent fa1f6a5d78
commit 64e918335c
62 changed files with 580 additions and 750 deletions

View File

@@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.entity.EntityType;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jspecify.annotations.NullMarked;
+
+/**
+ * Called before an entity is spawned into a world by a spawner.
@@ -30,17 +30,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * This only includes the spawner's location and not the full BlockState snapshot for performance reasons.
+ * If you really need it you have to get the spawner yourself.
+ */
+@NullMarked
+public class PreSpawnerSpawnEvent extends PreCreatureSpawnEvent {
+
+ @NotNull private final Location spawnerLocation;
+ private final Location spawnerLocation;
+
+ @ApiStatus.Internal
+ public PreSpawnerSpawnEvent(@NotNull Location location, @NotNull EntityType type, @NotNull Location spawnerLocation) {
+ public PreSpawnerSpawnEvent(final Location location, final EntityType type, final Location spawnerLocation) {
+ super(location, type, CreatureSpawnEvent.SpawnReason.SPAWNER);
+ this.spawnerLocation = spawnerLocation;
+ }
+
+ @NotNull
+ public Location getSpawnerLocation() {
+ return this.spawnerLocation.clone();
+ }