mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 04:22:32 +00:00
Make butterflies obey mob spawning gamerules
This commit is contained in:
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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user