Fix bonsai pot not returning a seed on harvest
@@ -174,6 +174,18 @@ public class BlockBonsaiPot extends BlockContainer {
}
}
+ @Override
+ public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) {
+ if (willHarvest) return true; //If it will harvest, delay deletion of the block until after getDrops
+ return super.removedByPlayer(state, world, pos, player, willHarvest);
+ }
+
+ @Override
+ public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, ItemStack tool) {
+ super.harvestBlock(world, player, pos, state, te, tool);
+ world.setBlockToAir(pos);
+ }
+
///////////////////////////////////////////
// BLOCKSTATES
///////////////////////////////////////////
