mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 16:58:34 +01:00
Nerfed the worm a little more and made sure he only actually ticks plants
This commit is contained in:
parent
97c9e0f454
commit
997e9c634c
1 changed files with 8 additions and 9 deletions
|
@ -11,10 +11,7 @@
|
|||
package de.ellpeck.actuallyadditions.mod.entity;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.util.Util;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBush;
|
||||
import net.minecraft.block.BlockDirt;
|
||||
import net.minecraft.block.BlockFarmland;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
@ -78,12 +75,13 @@ public class EntityWorm extends Entity{
|
|||
}
|
||||
}
|
||||
|
||||
if(isFarmland && this.worldObj.rand.nextFloat() >= 0.9F){
|
||||
if(isFarmland && this.worldObj.rand.nextFloat() >= 0.95F){
|
||||
BlockPos plant = pos.up();
|
||||
if(!this.worldObj.isAirBlock(plant)){
|
||||
IBlockState plantState = this.worldObj.getBlockState(plant);
|
||||
Block plantBlock = plantState.getBlock();
|
||||
|
||||
if((plantBlock instanceof IGrowable || plantBlock instanceof IPlantable) && !(plantBlock instanceof BlockGrass)){
|
||||
plantBlock.updateTick(this.worldObj, plant, plantState, Util.RANDOM);
|
||||
|
||||
IBlockState newState = this.worldObj.getBlockState(plant);
|
||||
|
@ -93,6 +91,7 @@ public class EntityWorm extends Entity{
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(isMiddlePose){
|
||||
this.setDead();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue