Fix CheckSpawn event logic for natural spawns.

This commit is contained in:
LexManos 2019-07-16 22:38:11 -07:00
parent 86e9425638
commit e6f032db1b

View file

@ -24,7 +24,7 @@
mobentity.func_70012_b((double)f, (double)k, (double)f1, p_222263_1_.field_73012_v.nextFloat() * 360.0F, 0.0F);
- if (playerentity.func_70092_e((double)f, (double)k, (double)f1) > 16384.0D && mobentity.func_213397_c(playerentity.func_70092_e((double)f, (double)k, (double)f1)) || !mobentity.func_213380_a(p_222263_1_, SpawnReason.NATURAL) || !mobentity.func_205019_a(p_222263_1_)) {
+ int canSpawn = net.minecraftforge.common.ForgeHooks.canEntitySpawn(mobentity, p_222263_1_, f, k, f1, null);
+ if (playerentity.func_70092_e((double)f, (double)k, (double)f1) > 16384.0D && (canSpawn == -1 || (canSpawn == 0 && (mobentity.func_213397_c(playerentity.func_70092_e((double)f, (double)k, (double)f1)) || !mobentity.func_213380_a(p_222263_1_, SpawnReason.NATURAL) || !mobentity.func_205019_a(p_222263_1_))))) {
+ if (canSpawn == -1 || (canSpawn == 0 && (playerentity.func_70092_e((double)f, (double)k, (double)f1) > 16384.0D && (mobentity.func_213397_c(playerentity.func_70092_e((double)f, (double)k, (double)f1)) || !mobentity.func_213380_a(p_222263_1_, SpawnReason.NATURAL) || !mobentity.func_205019_a(p_222263_1_))))) {
break label109;
}