mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 03:25:15 +01:00
Made golems spawning respect spawn-animals for real. Fixes BUKKIT-1124
This commit is contained in:
parent
fadc93060f
commit
0f659850b2
@ -41,7 +41,7 @@ public class BlockPumpkin extends BlockDirectional {
|
||||
super.onPlace(world, i, j, k);
|
||||
if (world.suppressPhysics) return; // CraftBukkit
|
||||
if (world.getTypeId(i, j - 1, k) == Block.SNOW_BLOCK.id && world.getTypeId(i, j - 2, k) == Block.SNOW_BLOCK.id) {
|
||||
if (!world.isStatic && world.getServer().getServer().spawnAnimals) { // CraftBukkit - make snowmen obey spawning rules
|
||||
if (!world.isStatic) {
|
||||
// CraftBukkit start - Use BlockStateListPopulator
|
||||
BlockStateListPopulator blockList = new BlockStateListPopulator(world.getWorld());
|
||||
|
||||
|
@ -880,10 +880,10 @@ public class World implements IBlockAccess {
|
||||
|
||||
// CraftBukkit start
|
||||
if (entity instanceof EntityLiving && !(entity instanceof EntityPlayer)) {
|
||||
boolean isAnimal = entity instanceof EntityAnimal || entity instanceof EntityWaterAnimal;
|
||||
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) {
|
||||
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 (isAnimal && !allowAnimals || isMonster && !allowMonsters) return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user