mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-18 15:07:38 +01:00
Filter entity spawning sanely.
This commit is contained in:
parent
0026a08fa8
commit
27a9b4c907
@ -882,7 +882,7 @@ public class World implements IBlockAccess {
|
||||
boolean isAnimal = entity instanceof EntityAnimal || entity instanceof EntityWaterAnimal || entity instanceof EntityGolem;
|
||||
boolean isMonster = entity instanceof EntityMonster || entity instanceof EntityGhast || entity instanceof EntitySlime;
|
||||
|
||||
if (spawnReason == SpawnReason.NATURAL || spawnReason == SpawnReason.CHUNK_GEN || spawnReason == SpawnReason.JOCKEY || spawnReason == SpawnReason.SPAWNER || spawnReason == SpawnReason.BED || spawnReason == SpawnReason.EGG || spawnReason == SpawnReason.VILLAGE_INVASION || spawnReason == SpawnReason.VILLAGE_DEFENSE || spawnReason == SpawnReason.BUILD_SNOWMAN || spawnReason == SpawnReason.BUILD_IRONGOLEM) {
|
||||
if (spawnReason != SpawnReason.CUSTOM) {
|
||||
if (isAnimal && !allowAnimals || isMonster && !allowMonsters) {
|
||||
entity.dead = true;
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user