mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-23 03:49:22 +01:00
Made worms fertilize more often
This commit is contained in:
parent
1fd25ec885
commit
43229f2d20
1 changed files with 6 additions and 2 deletions
|
@ -75,14 +75,18 @@ public class EntityWorm extends Entity{
|
|||
}
|
||||
}
|
||||
|
||||
if(isFarmland && this.worldObj.rand.nextFloat() >= 0.95F){
|
||||
if(isFarmland && this.worldObj.rand.nextFloat() >= 0.8F){
|
||||
BlockPos plant = pos.up();
|
||||
if(!this.worldObj.isAirBlock(plant)){
|
||||
IBlockState plantState = this.worldObj.getBlockState(plant);
|
||||
Block plantBlock = plantState.getBlock();
|
||||
|
||||
plantBlock.updateTick(this.worldObj, plant, plantState, Util.RANDOM);
|
||||
this.worldObj.playEvent(2005, plant, 0);
|
||||
|
||||
IBlockState newState = this.worldObj.getBlockState(plant);
|
||||
if(newState.getBlock().getMetaFromState(newState) != plantBlock.getMetaFromState(plantState)){
|
||||
this.worldObj.playEvent(2005, plant, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue