Make butterflies obey mob spawning gamerules

This commit is contained in:
temp1011 committed 2018-03-24 02:13:28 +00:00
1 parent 54a9da917d
commit 46f78ce7b3
1 file changed
+4
@@ -26,6 +26,10 @@ public class ButterflySpawner implements ILeafTickHandler {
@Override
public boolean onRandomLeafTick(ITree tree, World world, Random rand, BlockPos pos, boolean isDestroyed) {
if (!world.getGameRules().getBoolean("doMobSpawning")) {
return false;
}
if (rand.nextFloat() >= tree.getGenome().getSappiness() * tree.getGenome().getYield()) {
return false;
}