aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/util/SpawnUtil.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/util/SpawnUtil.patch')
-rw-r--r--patch-remap/og/net/minecraft/util/SpawnUtil.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/util/SpawnUtil.patch b/patch-remap/og/net/minecraft/util/SpawnUtil.patch
new file mode 100644
index 0000000000..150612747c
--- /dev/null
+++ b/patch-remap/og/net/minecraft/util/SpawnUtil.patch
@@ -0,0 +1,29 @@
+--- a/net/minecraft/util/SpawnUtil.java
++++ b/net/minecraft/util/SpawnUtil.java
+@@ -21,6 +21,12 @@
+ public SpawnUtil() {}
+
+ public static <T extends EntityInsentient> Optional<T> trySpawnMob(EntityTypes<T> entitytypes, EnumMobSpawn enummobspawn, WorldServer worldserver, BlockPosition blockposition, int i, int j, int k, SpawnUtil.a spawnutil_a) {
++ // CraftBukkit start
++ return trySpawnMob(entitytypes, enummobspawn, worldserver, blockposition, i, j, k, spawnutil_a, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT);
++ }
++
++ public static <T extends EntityInsentient> Optional<T> trySpawnMob(EntityTypes<T> entitytypes, EnumMobSpawn enummobspawn, WorldServer worldserver, BlockPosition blockposition, int i, int j, int k, SpawnUtil.a spawnutil_a, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) {
++ // CraftBukkit end
+ BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.mutable();
+
+ for (int l = 0; l < i; ++l) {
+@@ -29,11 +35,11 @@
+
+ blockposition_mutableblockposition.setWithOffset(blockposition, i1, k, j1);
+ if (worldserver.getWorldBorder().isWithinBounds((BlockPosition) blockposition_mutableblockposition) && moveToPossibleSpawnPosition(worldserver, k, blockposition_mutableblockposition, spawnutil_a)) {
+- T t0 = (EntityInsentient) entitytypes.create(worldserver, (NBTTagCompound) null, (Consumer) null, blockposition_mutableblockposition, enummobspawn, false, false);
++ T t0 = entitytypes.create(worldserver, (NBTTagCompound) null, null, blockposition_mutableblockposition, enummobspawn, false, false); // CraftBukkit - decompile error
+
+ if (t0 != null) {
+ if (t0.checkSpawnRules(worldserver, enummobspawn) && t0.checkSpawnObstruction(worldserver)) {
+- worldserver.addFreshEntityWithPassengers(t0);
++ worldserver.addFreshEntityWithPassengers(t0, reason); // CraftBukkit
+ return Optional.of(t0);
+ }
+