Skip to content

Commit

Permalink
Fix finding of spawn location for mobs. Closes #1546
Browse files Browse the repository at this point in the history
  • Loading branch information
LexManos committed Dec 3, 2014
1 parent c683bce commit 07db774
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch
Expand Up @@ -49,12 +49,12 @@
{
continue label115;
}
@@ -228,6 +237,8 @@
@@ -220,7 +229,7 @@
{
BlockPos blockpos1 = p_180267_2_.func_177977_b();

- if (!World.func_175683_a(p_180267_1_, blockpos1))
+ if (!p_180267_1_.func_180495_p(blockpos1).func_177230_c().canCreatureSpawn(p_180267_1_, blockpos1, p_180267_0_))
{
Block block1 = p_180267_1_.func_180495_p(blockpos1).func_177230_c();
boolean flag = block1 != Blocks.field_150357_h && block1 != Blocks.field_180401_cv;
+ BlockPos down = blockpos1.func_177977_b();
+ flag |= p_180267_1_.func_180495_p(down).func_177230_c().canCreatureSpawn(p_180267_1_, down, p_180267_0_);
return flag && !block.func_149721_r() && !block.func_149688_o().func_76224_d() && !p_180267_1_.func_180495_p(p_180267_2_.func_177984_a()).func_177230_c().func_149721_r();
return false;
}
}
2 changes: 1 addition & 1 deletion patches/minecraft/net/minecraft/world/World.java.patch
Expand Up @@ -319,7 +319,7 @@
+ Block block = chunk.func_177428_a(blockpos2);

- if (material.func_76230_c() && material != Material.field_151584_j)
+ if (block.func_149688_o().func_76230_c() && block.isLeaves(this, blockpos2) && !block.isFoliage(this, blockpos2))
+ if (block.func_149688_o().func_76230_c() && !block.isLeaves(this, blockpos2) && !block.isFoliage(this, blockpos2))
{
break;
}
Expand Down

0 comments on commit 07db774

Please sign in to comment.