diff options
author | Jake Potrebic <[email protected]> | 2023-08-13 17:41:18 -0700 |
---|---|---|
committer | Jake Potrebic <[email protected]> | 2023-08-15 10:04:27 -0700 |
commit | 496156e2eff4ec5a47aaf174cb1a04fd90612fde (patch) | |
tree | 87ddd26d4ed12c8bd8ad3723a70062b69c47110c /patches/api/0197-Spawn-Reason-API.patch | |
parent | 6dc8e30c9275f7a172025b053d4970d1795c6104 (diff) | |
download | Paper-experimental.tar.gz Paper-experimental.zip |
Update with latest upstream changesexperimental
Diffstat (limited to 'patches/api/0197-Spawn-Reason-API.patch')
-rw-r--r-- | patches/api/0197-Spawn-Reason-API.patch | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/patches/api/0197-Spawn-Reason-API.patch b/patches/api/0197-Spawn-Reason-API.patch index ff70668d2a..5c01ed0379 100644 --- a/patches/api/0197-Spawn-Reason-API.patch +++ b/patches/api/0197-Spawn-Reason-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Spawn Reason API diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java -index 8264599a873ed23ec6552d1550a414ec3712487b..f53622413ecfb98b79bc59a397e1c7bd27951fb1 100644 +index 8264599a873ed23ec6552d1550a414ec3712487b..3806e420af559ddb26c567523b656c79a635b229 100644 --- a/src/main/java/org/bukkit/RegionAccessor.java +++ b/src/main/java/org/bukkit/RegionAccessor.java @@ -11,6 +11,7 @@ import org.bukkit.block.data.BlockData; @@ -16,7 +16,7 @@ index 8264599a873ed23ec6552d1550a414ec3712487b..f53622413ecfb98b79bc59a397e1c7bd import org.bukkit.util.Consumer; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -@@ -312,7 +313,34 @@ public interface RegionAccessor { +@@ -312,7 +313,36 @@ public interface RegionAccessor { * {@link Entity} requested cannot be spawned */ @NotNull @@ -37,13 +37,15 @@ index 8264599a873ed23ec6552d1550a414ec3712487b..f53622413ecfb98b79bc59a397e1c7bd + } + + @NotNull -+ public default Entity spawnEntity(@NotNull Location loc, @NotNull org.bukkit.entity.EntityType type, @NotNull CreatureSpawnEvent.SpawnReason reason) { -+ return spawn(loc, (Class<Entity>) type.getEntityClass(), reason, null); ++ public default <T extends Entity> Entity spawnEntity(@NotNull Location loc, @NotNull EntityType<T> type, @NotNull CreatureSpawnEvent.SpawnReason reason) { ++ com.google.common.base.Preconditions.checkArgument(type.getEntityClass() != null); ++ return spawn(loc, type.getEntityClass(), reason, null); + } + + @NotNull -+ public default Entity spawnEntity(@NotNull Location loc, @NotNull org.bukkit.entity.EntityType type, @NotNull CreatureSpawnEvent.SpawnReason reason, @Nullable Consumer<Entity> function) { -+ return spawn(loc, (Class<Entity>) type.getEntityClass(), reason, function); ++ public default <T extends Entity> Entity spawnEntity(@NotNull Location loc, @NotNull EntityType<T> type, @NotNull CreatureSpawnEvent.SpawnReason reason, @Nullable Consumer<T> function) { ++ com.google.common.base.Preconditions.checkArgument(type.getEntityClass() != null); ++ return spawn(loc, type.getEntityClass(), reason, function); + } + + @NotNull |