Skip to content

Commit

Permalink
Fix moose not eating grass blocks and turning tall grass into dirt
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmeow committed Nov 21, 2019
1 parent c2fe554 commit f1f8d31
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public boolean shouldExecute() {
return false;
} else {
BlockPos blockpos = getPosition.apply(eater);
return IS_GRASS.test(this.world.getBlockState(blockpos)) || this.world.getBlockState(blockpos.down()).getBlock() == Blocks.GRASS;
return IS_GRASS.test(this.world.getBlockState(blockpos)) || this.world.getBlockState(blockpos.down()).getBlock() == Blocks.GRASS_BLOCK;
}
}

Expand Down Expand Up @@ -79,9 +79,9 @@ public void tick() {
this.eater.eatGrassBonus();
} else {
BlockPos blockpos1 = blockpos.down();
if(this.world.getBlockState(blockpos1).getBlock() == Blocks.GRASS) {
if(this.world.getBlockState(blockpos1).getBlock() == Blocks.GRASS_BLOCK) {
if(net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this.eater)) {
this.world.playEvent(2001, blockpos1, Block.getStateId(Blocks.GRASS.getDefaultState()));
this.world.playEvent(2001, blockpos1, Block.getStateId(Blocks.GRASS_BLOCK.getDefaultState()));
this.world.setBlockState(blockpos1, Blocks.DIRT.getDefaultState(), 2);
}
this.eater.eatGrassBonus();
Expand Down

0 comments on commit f1f8d31

Please sign in to comment.