mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-11 15:57:32 +00:00
Fix erroneous getLevel call when firing SpecialSpawn (#9520)
This commit is contained in:
1 parent
1dd18ca27c
commit
babef71616
3 files changed
+3
-3
No files matched your search
@@ -4,7 +4,7 @@
|
||||
|
||||
private SpawnGroupData m_33881_(ServerLevelAccessor p_33882_, DifficultyInstance p_33883_, Mob p_33884_, @Nullable SpawnGroupData p_33885_) {
|
||||
p_33884_.m_7678_(this.m_20185_(), this.m_20186_(), this.m_20189_(), this.m_146908_(), 0.0F);
|
||||
+ if (!net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn(p_33884_, p_33882_.m_6018_(), (float)p_33884_.m_20185_(), (float)p_33884_.m_20186_(), (float)p_33884_.m_20189_(), null, MobSpawnType.JOCKEY))
|
||||
+ if (!net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn(p_33884_, p_33882_, (float)p_33884_.m_20185_(), (float)p_33884_.m_20186_(), (float)p_33884_.m_20189_(), null, MobSpawnType.JOCKEY))
|
||||
p_33884_.m_6518_(p_33882_, p_33883_, MobSpawnType.JOCKEY, p_33885_, (CompoundTag)null);
|
||||
p_33884_.m_7998_(this, true);
|
||||
return new AgeableMob.AgeableMobGroupData(0.0F);
|
||||
@@ -12,7 +12,7 @@
|
||||
}
|
||||
|
||||
+ // Fire this early so mods can react to mobs that vanilla normally ignores.
|
||||
+ if (!net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn(mob, (LevelAccessor)p_151312_, (float)entity.m_20185_(), (float)entity.m_20186_(), (float)entity.m_20189_(), this, MobSpawnType.SPAWNER))
|
||||
+ if (!net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn(mob, p_151312_, (float)entity.m_20185_(), (float)entity.m_20186_(), (float)entity.m_20189_(), this, MobSpawnType.SPAWNER))
|
||||
if (this.f_45444_.m_186567_().m_128440_() == 1 && this.f_45444_.m_186567_().m_128425_("id", 8)) {
|
||||
((Mob)entity).m_6518_(p_151312_, p_151312_.m_6436_(entity.m_20183_()), MobSpawnType.SPAWNER, (SpawnGroupData)null, (CompoundTag)null);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
- if (m_46991_(p_47040_, mob, d2)) {
|
||||
+ int canSpawn = net.minecraftforge.common.ForgeHooks.canEntitySpawn(mob, p_47040_, d0, i, d1, null, MobSpawnType.NATURAL);
|
||||
+ if (canSpawn == 1 || (canSpawn == 0 && m_46991_(p_47040_, mob, d2))) {
|
||||
+ if (!net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn(mob, (LevelAccessor) p_47040_, (float)d0, (float)i, (float)d1, null, MobSpawnType.NATURAL))
|
||||
+ if (!net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn(mob, p_47040_, (float)d0, (float)i, (float)d1, null, MobSpawnType.NATURAL))
|
||||
spawngroupdata = mob.m_6518_(p_47040_, p_47040_.m_6436_(mob.m_20183_()), MobSpawnType.NATURAL, spawngroupdata, (CompoundTag)null);
|
||||
++j;
|
||||
++l1;
|
||||
|
||||
Reference in new issue
Block a user