mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-23 03:49:22 +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,17 +75,19 @@ 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();
|
||||
|
||||
plantBlock.updateTick(this.worldObj, plant, plantState, Util.RANDOM);
|
||||
if((plantBlock instanceof IGrowable || plantBlock instanceof IPlantable) && !(plantBlock instanceof BlockGrass)){
|
||||
plantBlock.updateTick(this.worldObj, plant, plantState, Util.RANDOM);
|
||||
|
||||
IBlockState newState = this.worldObj.getBlockState(plant);
|
||||
if(newState.getBlock().getMetaFromState(newState) != plantBlock.getMetaFromState(plantState)){
|
||||
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