mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +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,14 +71,10 @@ public class DefaultFarmerBehavior implements IFarmerBehavior{
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean tryPlant(IBlockState toPlant, World world, BlockPos pos){
|
private static boolean tryPlant(IBlockState toPlant, World world, BlockPos pos){
|
||||||
BlockBush plantBlock = (BlockBush)toPlant.getBlock();
|
if(toPlant.getBlock().canPlaceBlockAt(world, pos)){
|
||||||
if(plantBlock.canPlaceBlockAt(world, pos) && plantBlock.canBlockStay(world, pos, toPlant)){
|
world.setBlockState(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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue