mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 19:39:24 +01:00
Don't cast every IPlantable to BlockBush
This commit is contained in:
parent
f5ae3240f8
commit
bfe876f423
1 changed files with 3 additions and 7 deletions
|
@ -71,13 +71,9 @@ public class DefaultFarmerBehavior implements IFarmerBehavior{
|
|||
}
|
||||
|
||||
private static boolean tryPlant(IBlockState toPlant, World world, BlockPos pos){
|
||||
BlockBush plantBlock = (BlockBush)toPlant.getBlock();
|
||||
if(plantBlock.canPlaceBlockAt(world, pos) && plantBlock.canBlockStay(world, pos, toPlant)){
|
||||
//This fixes a bug with Beetroot being able to be planted anywhere because Minecraft sucks
|
||||
if(plantBlock != Blocks.BEETROOTS || Blocks.WHEAT.canPlaceBlockAt(world, pos)){
|
||||
world.setBlockState(pos, toPlant, 3);
|
||||
return true;
|
||||
}
|
||||
if(toPlant.getBlock().canPlaceBlockAt(world, pos)){
|
||||
world.setBlockState(pos, toPlant);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue