aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/util/SpawnUtil.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/util/SpawnUtil.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/util/SpawnUtil.java.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/util/SpawnUtil.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/util/SpawnUtil.java.patch
new file mode 100644
index 0000000000..3eb9602d45
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/util/SpawnUtil.java.patch
@@ -0,0 +1,31 @@
+--- a/net/minecraft/util/SpawnUtil.java
++++ b/net/minecraft/util/SpawnUtil.java
+@@ -20,9 +20,15 @@
+
+ public SpawnUtil() {}
+
+- public static <T extends Mob> Optional<T> trySpawnMob(EntityType<T> entitytype, MobSpawnType mobspawntype, ServerLevel serverlevel, BlockPos blockpos, int i, int j, int k, SpawnUtil.Strategy spawnutil_strategy) {
+- BlockPos.MutableBlockPos blockpos_mutableblockpos = blockpos.mutable();
++ public static <T extends Mob> Optional<T> trySpawnMob(EntityType<T> entityType, EnumMobSpawn spawnType, ServerLevel level, BlockPos pos, int attempts, int j, int yOffset, SpawnUtil.Strategy strategy) {
++ // CraftBukkit start
++ return trySpawnMob(entityType, spawnType, level, pos, attempts, j, yOffset, strategy, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT);
++ }
+
++ public static <T extends Mob> Optional<T> trySpawnMob(EntityType<T> entitytypes, EnumMobSpawn enummobspawn, ServerLevel worldserver, BlockPos blockposition, int i, int j, int k, SpawnUtil.Strategy spawnutil_a, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) {
++ // CraftBukkit end
++ BlockPos.MutableBlockPos blockposition_mutableblockposition = blockposition.mutable();
++
+ for (int l = 0; l < i; ++l) {
+ int i1 = Mth.randomBetweenInclusive(serverlevel.random, -j, j);
+ int j1 = Mth.randomBetweenInclusive(serverlevel.random, -j, j);
+@@ -32,8 +38,8 @@
+ T t0 = (Mob) entitytype.create(serverlevel, (CompoundTag) null, (Consumer) null, blockpos_mutableblockpos, mobspawntype, false, false);
+
+ if (t0 != null) {
+- if (t0.checkSpawnRules(serverlevel, mobspawntype) && t0.checkSpawnObstruction(serverlevel)) {
+- serverlevel.addFreshEntityWithPassengers(t0);
++ if (t0.checkSpawnRules(worldserver, enummobspawn) && t0.checkSpawnObstruction(worldserver)) {
++ worldserver.addFreshEntityWithPassengers(t0, reason); // CraftBukkit
+ return Optional.of(t0);
+ }
+