1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-02-03 21:37:28 +01:00

Do not break when PlayerNaturallySpawnCreaturesEvent is cancelled

If there is a player nearby which had its event not cancelled,
then that should take precedence.
This commit is contained in:
Spottedleaf 2024-12-01 13:53:04 -08:00
parent 6788ba5e80
commit de3742283b

View file

@ -34,7 +34,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ blockRange = 16384.0D;
+ if (reducedRange) {
+ event = entityplayer.playerNaturallySpawnedEvent;
+ if (event == null || event.isCancelled()) return false;
+ if (event == null || event.isCancelled()) continue;
+ blockRange = (double) ((event.getSpawnRadius() << 4) * (event.getSpawnRadius() << 4));
+ }
+ // Paper end - PlayerNaturallySpawnCreaturesEvent