mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-07 15:42:19 -07:00
Begin switching to JSpecify annotations (#11448)
* Begin switching to JSpecify annotations * more * fixes
This commit is contained in:
@@ -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();
|
||||
+ }
|
||||
|
Reference in New Issue
Block a user