aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0197-Spawn-Reason-API.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/api/0197-Spawn-Reason-API.patch')
-rw-r--r--patches/api/0197-Spawn-Reason-API.patch14
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